03.04.2011, 11:52
Enum fixed it.
But there is another problem. This is my command:
i removed some returns like "Bad player ID", "No params" etc, i don't want to translate it now
So, this works perfectly. But, when i type eg. "deaglec" (some error in name), it doesnt return "Bad gun ID or name!", but "Server: Unknown command". Some ideas?
But there is another problem. This is my command:
pawn Код:
dcmd_giveweapon(playerid,params[])
{
new
ID,
Weapon[50],
Ammo,
model=666
;
sscanf(params,"us[50]I(100000)",ID,Weapon,Ammo)
printf("ID: %d | Weapon: %s | Ammo: %d",ID,Weapon,Ammo);
new i=0;
while(i<=sizeof(gWeaponNames))
{
if(strcmp(Weapon,gWeaponNames[i][z_nazov],true)==0)
{
model=i;
break;
}else i++;
}
model=gWeaponNames[model][z_id];
if(model==666)
{
new zbran=strval(Weapon);
if((zbran>=0 && zbran <= 47) && (zbran!=19 && zbran!= 20 && zbran!= 21))
{
model=zbran;
}
}
if(model==666) return SCM(playerid,red,"Bad gun ID or name!");
printf("ID: %d | Model: %d | Ammo: %d",ID,model,Ammo);
GivePlayerWeapon(ID,model,Ammo);
return 1;
}
So, this works perfectly. But, when i type eg. "deaglec" (some error in name), it doesnt return "Bad gun ID or name!", but "Server: Unknown command". Some ideas?