When i use an command, ID 0 is seems to always be bugged. When i use a command like /goto or /sethealth or /setarmor and my ID is 0, If i type ID 1, It will change ID's 0 Health or Armor.
pawn Код:
Here are some Commands.
CMD:goto(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >=5)
{
new id,Float:X,Float:Y,Float:Z,pName[MAX_PLAYER_NAME],string[126],iName[MAX_PLAYER_NAME],string2[126];
if (unformat(params, "u",id))SendClientMessage(playerid,COLOR_RED,"Usage: /Goto [ID]");
if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
else
{
new vWorld = GetPlayerVirtualWorld(id);
SetPlayerVirtualWorld(playerid,vWorld);
new Interior = GetPlayerInterior(id);
SetPlayerInterior(playerid,Interior);
GetPlayerPos(id,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z);
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string,128,"Admin %s has teleported to you",pName);
SendClientMessage(id,COLOR_ORANGE,string);
GetPlayerName(id, iName, MAX_PLAYER_NAME);
format(string2,128,"You have gone to %s",iName);
SendClientMessage(id,COLOR_ORANGE,string2);
}
}
return 1;
}
CMD:gethere(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >=5)
{
new id,Float:X,Float:Y,Float:Z,pName[MAX_PLAYER_NAME],string[126],iName[MAX_PLAYER_NAME],string2[126];
if (unformat(params, "u",id))SendClientMessage(playerid,COLOR_RED,"Usage: /Gethere [ID]");
if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
else
{
new vWorld = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(id,vWorld);
new Interior = GetPlayerInterior(playerid);
SetPlayerInterior(id,Interior);
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(id,X,Y,Z);
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string,128,"Admin %s has teleported you",pName);
SendClientMessage(id,COLOR_ORANGE,string);
GetPlayerName(id, iName, MAX_PLAYER_NAME);
format(string2,128,"You have Gotten to %s",iName);
SendClientMessage(id,COLOR_ORANGE,string2);
}
}
return 1;
}
You need to either return (exit the function) with a SendClientMessage or create a logical flow of operation. The code above is the easy way of doing it. Even though you send the message, the rest of the function is processed, and since id will default to 0 which is a valid Player ID, it will execute for them.
It has nothing to do with his commands. The Update 4 of sscanf 2.0 was made to work only with 0.3d (ONLY) not 0.3d R2. I had this problem sometime yesterday when my server was on 0.3d R2 so I downgraded it to 0.3d. That should be your solution.