16.09.2011, 19:42
Tambiйn puedes hacer /armas 1 /armas 2 etc..
pawn Код:
if(strcmp(cmdtext, "/armas", true)==0)
{
new idx;
new tmp = strtok(cmdtext, idx);
if(tmp=="1")
{
GivePlayerWeapon(playerid, idarma, balas);
GivePlayerWeapon(playerid, idarma, balas);
}
if(tmp=="2")
{
//GivePlayerWeapon
}
return 1;
}
stock 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;
}