if (strcmp(cmd, "/try", true)==0) { if(cmdtext[4] == ' ') { new plyName[MAX_PLAYER_NAME]; new buffer[255]; new rand = random(20); new message[256]; strdel(cmdtext, 0, 4); if(rand >= 10) { format(buffer, sizeof(buffer), "* %s intenta %s y lo consigue", plyName, message); }else { format(buffer, sizeof(buffer), "* %s intenta %s pero falla", plyName, message); } for(new ply; ply != MAX_PLAYERS; ply++) { { SendClientMessage(ply, 0x00FFFF, buffer); } } }else { SendClientMessage(playerid, 0xFF0000FF, "USA: /try [accion]"); } return 1; } |
if (strcmp(cmd, "/try", true)==0)
{
new plyName[MAX_PLAYER_NAME];
new buffer[128];
new rand = random(2);
new message[256];
tmp = strtok(cmdtext, idx);
new option[128];
option = strtok(cmdtext, idx);
if(!strlen(option))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "USA: /try [accion]");
return 1;
}
GetPlayerName(playerid, plyName, sizeof(plyName));
if(strcmp(option,"smoke",true) == 0)
{
if(rand == 2)
{
format(buffer, sizeof(buffer), "* %s intenta %s y lo consigue", plyName, message);
}
else
{
format(buffer, sizeof(buffer), "* %s intenta %s pero falla", plyName, message);
}
SendClientMessage(playerid, 0x00FFFF, buffer);
}
}
return 1;
}
C:\Users\Pablo\Desktop\Sona GM\gamemodes\Sona.pwn(1175) : error 017: undefined symbol "tmp" |
if (strcmp(cmd, "/try", true)==0) { if(cmdtext[4] == ' ') { new plyName[MAX_PLAYER_NAME]; new buffer[255]; new rand = random(2); new message[256]; strdel(cmdtext, 0, 4); if(rand >= 10) { format(buffer, sizeof(buffer), "* %s intenta %s y lo consigue", plyName, message); }else { format(buffer, sizeof(buffer), "* %s intenta %s pero falla", plyName, message); } for(new ply; ply != MAX_PLAYERS; ply++) { { SendClientMessage(ply, 0x00FFFF, buffer); } } }else { SendClientMessage(playerid, 0xFF0000FF, "USA: /try [accion]"); } return 1; } |
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
if(!strcmp(cmdtext,"/try",true))
{
if(cmdtext[idx++]!=32||cmdtext[idx]==EOS) return SendClientMessage(playerid,color,"/try [action]");
format(string,sizeof(string),"* %s attempts to %s",name,cmdtext[idx]);
switch(random(2))
{
case 0: format(string,sizeof(string),"%s, and succeeds.",string);
default: format(string,sizeof(string),"%s, but fails.",string);
}
SendClientMessageToAll(color,string);
return 1;
}
C:\Users\Pablo\Desktop\Sona GM\gamemodes\Sona.pwn(1175) : error 017: undefined symbol "tmp" |
Originally Posted by MenaceX^
Use my code...
|
Originally Posted by pablodc
Quote:
C:\Users\Pablo\Desktop\Sona GM\gamemodes\Sona.pwn(1147) : error 017: undefined symbol "color" C:\Users\Pablo\Desktop\Sona GM\gamemodes\Sona.pwn(114 ![]() C:\Users\Pablo\Desktop\Sona GM\gamemodes\Sona.pwn(114 ![]() C:\Users\Pablo\Desktop\Sona GM\gamemodes\Sona.pwn(114 ![]() C:\Users\Pablo\Desktop\Sona GM\gamemodes\Sona.pwn(114 ![]() |