Sscanf Bug, PlayerID - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sscanf Bug, PlayerID (
/showthread.php?tid=506701)
Sscanf Bug, PlayerID -
KevinPRINCE - 14.04.2014
Ok,
so I have a working script, that actually works. However some commands, in fact all commands. Like /gotoid returns Invalid player Specified for some IDs. I have checked the script, its fine. Not sure what the problem is. My sscanf is updated to the latest.
Код:
CMD:gotoid(playerid, params[])
{
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /gotoid [player]");
new Float:plocx,Float:plocy,Float:plocz;
if (IsPlayerConnected(giveplayerid))
{
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "That person is spectating someone.");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You can not do this while spectating.");
return 1;
}
if(PlayerInfo[giveplayerid][pAdmin] == 99999 && !GetPVarType(giveplayerid, "EATeleportable")) return SendClientMessageEx(playerid, COLOR_WHITE, "You cannot teleport to them");
GetPlayerPos(giveplayerid, plocx, plocy, plocz);
SetPlayerVirtualWorld(playerid, PlayerInfo[giveplayerid][pVW]);
Streamer_UpdateEx(playerid, plocx, plocy, plocz);
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
fVehSpeed[playerid] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
}
SendClientMessageEx(playerid, COLOR_GRAD1, " You have been teleported!");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
}
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
return 1;
}
Yes, I am using NGG edit. Before you go reporting it, know that I edited nearly 10% of 100,000+ lines. Enough to counterclaim their DMCA.
Thank you to those that will actually help and not whine over the fact that I am using a NGG edit and not something unique, because I am trying to change it around an making it unique also I have edited alot of the script, and still doing so. Also added few of my mine system, ATM working on dynamic jobs which NGG doesn't even have.
Question: Does the fixes.inc of ****** have to do anything with it? Because I am not using it.