SA-MP Forums Archive
[Help] Scripting issue - 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: [Help] Scripting issue (/showthread.php?tid=335276)



[Help] Scripting issue - Frank_Fricovsky - 17.04.2012

alright with any command on my script that deals with playerid , it does not work for someone with the id over 3 so ex: /gotoid 3 would send me to ethier id 1 or id 0 any ideas on how to fix this?


Re: [Help] Scripting issue - Skribblez - 17.04.2012

Post the code for your "/gotoid" command.


Re: [Help] Scripting issue - Frank_Fricovsky - 17.04.2012

thing is I dont think its the command its self.. its happening for all the commands that require "playerid" such as , /makeadmin /gethere /gotoid etc


Re: [Help] Scripting issue - Skribblez - 17.04.2012

I know, that's why I'm asking for a code since it's all happening with other commands. It might be the system wherein you're trying to get the player's ID. Are you using sscanf?


Re: [Help] Scripting issue - Frank_Fricovsky - 17.04.2012

yes Im using sscanf

Код:
CMD:gotoid(playerid, params[])
{
	new giveplayerid;
	if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_ORANGE, "USAGE: /gotoid [playerid]");

	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 player is spectating someone.");
				return 1;
			}
			if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
			{
				SendClientMessageEx(playerid, COLOR_GRAD2, "You can not do this while spectating.");
				return 1;
			}
			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);
				TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 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 by an admin!");
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
		}

	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
	return 1;
}



Re: [Help] Scripting issue - Lilcuete - 18.04.2012

Try adding this under
Код:
new giveplayerid;
        giveplayerid = ReturnUser(tmp);
maybe this is why its only responding to id 0 or 1 sense it can't find the players id.


Re: [Help] Scripting issue - Skribblez - 18.04.2012

Nope, he's using sscanf which already has a specifier for a certain player ID which is "u", I don't see anything wrong with your code. Have you tried updating your plugins? Make sure to have the latest versions.


Re: [Help] Scripting issue - Frank_Fricovsky - 18.04.2012

Plugins or Includes?, I've updated the sscanf plugin still didnt work


Re: [Help] Scripting issue - Mark™ - 18.04.2012

Quote:
Originally Posted by Frank_Fricovsky
Посмотреть сообщение
alright with any command on my script that deals with playerid , it does not work for someone with the id over 3 so ex: /gotoid 3 would send me to ethier id 1 or id 0 any ideas on how to fix this?
Your command's fine, the only thing you need to do is update your sscanf plugin to the latest v2.6 . Extract the .inc include from the sscanf plugin package and replace that include with the old one in pawno >>include folder. Recompile your script.