SA-MP Forums Archive
Problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem (/showthread.php?tid=73244)



Problem - Packer5 - 13.04.2009

Hey, for my RP server, I want the command /showmebank to take the player infront of the bank to show them where it is, but they cant move, and when they are done, they can do /takemeback and it will take them back to where they were... I am a noob scripter and I came up with this but it returns errors.

Код:
	if(strcmp(cmd,"/showmebank", true) ==0)
	{
		GetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerPos(playerid, 0,0,0)
		SetPlayerControllable(playerid, 0)
 }
		else if(strcmp(cmd,"/takemeback", true) ==0)
 {
    SetPlayerPos(playerid, x, y, z);
		return 1;
 }
(thats saying 0,0,0, is the bank, (as test))

thanks


Re: Problem - Packer5 - 13.04.2009

Код:
	if(strcmp(cmd,"/showmebank", true) ==0)
	{
		GetPlayerPos(playerid, Float:x, Float:y, Float:z);
		SetPlayerPos(playerid, 0,0,0);
		SetPlayerControllable(playerid, 0);
 }
		else if(strcmp(cmd,"/takemeback", true) ==0)
 {
    SetPlayerPos(playerid, x, y, z);
		return 1;
 }
Sorry.. I put the ; where they are required but I still get this:

Код:
C:\Documents and Settings\Tom\Desktop\gf.pwn(10901) : error 017: undefined symbol "x"
C:\Documents and Settings\Tom\Desktop\gf.pwn(10903) : error 017: undefined symbol "SetPlayerControllable"
C:\Documents and Settings\Tom\Desktop\gf.pwn(10907) : error 017: undefined symbol "x"



Re: Problem - GanG$Ta - 13.04.2009

Код:
new Float:Pos[3],Bank_A[MAX_PLAYERS];

if(strcmp(cmd,"/bank", true) ==0)
{
if(!Bank_A[playerid])
{
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid,0,0,0);
TogglePlayerControllable(playerid,false);
Bank_A[playerid]=true;
}
else if(Bank_A[playerid])
{
SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
TogglePlayerControllable(playerid,true);
Bank_A[playerid]=false;
}
return true;
}



Re: Problem - Packer5 - 13.04.2009

thank you