SHOW:
|
|
- or go back to the newest paste.
| 1 | new cmd[256]; | |
| 2 | - | new tmp[256]; |
| 2 | + | new tmp[256]; |
| 3 | - | new haz; |
| 3 | + | new haz; |
| 4 | - | new idex; |
| 4 | + | new idex; |
| 5 | ||
| 6 | cmd = strtok(cmdtext, idex); | |
| 7 | ||
| 8 | - | if(format(cmd, 256,"skin")) |
| 8 | + | if (format(cmd, 256, "skin")) |
| 9 | - | if(GetPlayerTeam(playerid)== TEAM_HUMAIN) |
| 9 | + | if (GetPlayerTeam(playerid) == TEAM_HUMAIN) {
|
| 10 | - | {
|
| 10 | + | tmp = strtok(cmdtext, idex); |
| 11 | - | tmp = strtok(cmdtext, idex); |
| 11 | + | |
| 12 | - | if(!strlen(tmp)) |
| 12 | + | if (!strlen(tmp)) {
|
| 13 | - | {
|
| 13 | + | SendClientMessage(playerid, rouge, "USAGE: /skin [id skin]"); |
| 14 | - | SendClientMessage(playerid, rouge, "USAGE: /skin [id skin]"); |
| 14 | + | |
| 15 | - | return 1; |
| 15 | + | return 1; |
| 16 | - | } |
| 16 | + | } |
| 17 | - | haz = strval(tmp); |
| 17 | + | |
| 18 | - | SetPlayerSkin(playerid, haz); |
| 18 | + | haz = strval(tmp); |
| 19 | - | format(string, sizeof(string),"Tu as changé de skin pour l'ID: %d",haz); |
| 19 | + | |
| 20 | - | SendClientMessage(playerid, rouge, string); |
| 20 | + | SetPlayerSkin(playerid, haz); |
| 21 | - | } |
| 21 | + | format(string, sizeof(string),"Tu as changé de skin pour l'ID: %d",haz); |
| 22 | - | if(haz == 162) |
| 22 | + | SendClientMessage(playerid, rouge, string); |
| 23 | - | {
|
| 23 | + | } |
| 24 | - | format(string, sizeof(string),"Un zombie-humain, t'as déjà vu ça ?!",haz); |
| 24 | + | |
| 25 | - | SendClientMessage(playerid, rouge, string); |
| 25 | + | if (haz == 162) {
|
| 26 | - | SetPlayerSkin(playerid, 137); |
| 26 | + | format(string, sizeof(string),"Un zombie-humain, t'as déjà vu ça ?!",haz); |
| 27 | - | return 1; |
| 27 | + | SendClientMessage(playerid, rouge, string); |
| 28 | - | } |
| 28 | + | SetPlayerSkin(playerid, 137); |
| 29 | - | if(GetPlayerTeam(playerid)== TEAM_ZOMBIE) |
| 29 | + | |
| 30 | - | {
|
| 30 | + | return 1; |
| 31 | - | SendClientMessage(playerid, rouge, "Tu dois être un humain pour utilisé cette commande"); |
| 31 | + | |
| 32 | ||
| 33 | if (GetPlayerTeam(playerid) == TEAM_ZOMBIE) {
| |
| 34 | - | } |
| 34 | + | SendClientMessage(playerid, rouge, "Tu dois être un humain pour utilisé cette commande"); |
| 35 | } | |
| 36 | - | strtok(const stringa[], &index) |
| 36 | + | |
| 37 | - | {
|
| 37 | + | } |
| 38 | - | new length = strlen(stringa); |
| 38 | + | |
| 39 | - | while ((index < length) && (stringa[index] <= ' ')) |
| 39 | + | strtok(const stringa[], &index) {
|
| 40 | - | {
|
| 40 | + | new length = strlen(stringa); |
| 41 | - | index++; |
| 41 | + | |
| 42 | - | } |
| 42 | + | while ((index < length) && (stringa[index] <= ' ')) {
|
| 43 | index++; | |
| 44 | - | new offset = index; |
| 44 | + | |
| 45 | - | new result[20]; |
| 45 | + | |
| 46 | - | while ((index < length) && (stringa[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) |
| 46 | + | new offset = index; |
| 47 | - | {
|
| 47 | + | new result[20]; |
| 48 | - | result[index - offset] = stringa[index]; |
| 48 | + | |
| 49 | - | index++; |
| 49 | + | while ((index < length) && (stringa[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) {
|
| 50 | - | } |
| 50 | + | result[index - offset] = stringa[index]; |
| 51 | - | result[index - offset] = EOS; |
| 51 | + | index++; |
| 52 | - | return result; |
| 52 | + | |
| 53 | ||
| 54 | result[index - offset] = EOS; | |
| 55 | ||
| 56 | return result; |