27.03.2010, 14:09
ok, this is my command
i get no errors or warnings
and when i use it ingame and set the skill for pistols to 0 one pistol disappears
that works fine...
the problem is, if i want to set the skill back to 999 nothing happens.
whats wrong with this^^
Код:
if(strcmp(cmd, "/wskill", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "VERWENDE: /wskill [SpielerID] [Waffe 0-10] [WaffenSkill 0-999]");
SendClientMessage(playerid, COLOR_WHITE, " [0=Pistol, 1=SPistol, 2=Eagle, 3=Shotgun, 4=SawnOff,");
SendClientMessage(playerid, COLOR_WHITE, " 5=Combat, 6=Mac10, 7=MP5, 8=AK47, 9=M4, 10=Sniper]");
return 1;
}
new playa;
new skill;
new level;
playa = strval(tmp);
tmp = strtok(cmdtext, idx);
skill = strval(tmp);
level = strval(tmp);
if(IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
SetPlayerSkillLevel(playa, skill, level);
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Unknown command.");
}
}
return 1;
}
i get no errors or warnings
and when i use it ingame and set the skill for pistols to 0 one pistol disappears
that works fine...
the problem is, if i want to set the skill back to 999 nothing happens.
whats wrong with this^^

