setweaponskill problem
#1

ok, this is my command

Код:
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^^







Reply
#2

pawn Код:
if(strcmp(cmd, "/wskill", true) == 0)
        {
            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 = strval(tmp);
            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 skill = strval(tmp);
            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 level = strval(tmp);
            if(IsPlayerAdmin(playerid))
            {
                if(IsPlayerConnected(playa))
                {
                    SetPlayerSkillLevel(playa, skill, level);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "SERVER: Unknown command.");
            }
            return 1;
        }
Reply
#3

Quote:

PAWN Code:

if(strcmp(cmd, "/wskill", true) == 0)
{
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 = strval(tmp);
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 skill = strval(tmp);
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 level = strval(tmp);
if(IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playa))
{
SetPlayerSkillLevel(playa, skill, level);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Unknown command.");
}
return 1;
}


yeah thats it^^

thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)