[Help] Scripting issue
#1

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?
Reply
#2

Post the code for your "/gotoid" command.
Reply
#3

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
Reply
#4

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?
Reply
#5

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;
}
Reply
#6

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.
Reply
#7

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.
Reply
#8

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)