16.09.2011, 19:12
bueno ps como hago el comando para poner el pack de armas asi como el 1,2,3 etc que sea /armas1 y salen todas las armas del pack 1 del san andreas normal menos las bazukas ps xD sin que le cobren dinero xD
if(strcmp(cmdtext, "/armas1", true) == 0)
{
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerWeapon(playerid, 34, 9999);
return 1;
}
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;
}
if (!strcmp(cmdtext, "/pack 1", true))
{
GivePlayerWeapon(playerid, 2, 9999);
return 1;
}
else if(!strcmp(cmdtext, "/pack 2", true))
{
GivePlayerWeapon(playerid, 1, 99999);
return 1;
}