SA-MP Forums Archive
problem in command - 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 in command (/showthread.php?tid=272580)



problem in command - marik1599 - 29.07.2011

i create a command that admin can change a team to player.
the problem is that i can't use this command on players it's affect only me..
i mean that when i typing /ru (id) never mind the id that i put it will affect me
tnx for helping
PHP код:
command(ruplayeridparams[ ])
{
     new 
id;
     if ( 
AdminLevelplayerid ] != 1337 )
     return 
SendClientMessageplayeridRed"Invalid Command" );
     if ( 
sscanfparams"u"id ) )
     return 
SendClientMessageplayeridRed"Usage: /ru [playerid/PartOfName]" );
     
SendClientMessageid,Lime"You have been forced to Russia team by a Server Admin.");
     
Setteam(playerid0);
     return 
1;




Re: problem in command - Famalamalam - 29.07.2011

pawn Код:
Setteam(id, 0);



Re: problem in command - marik1599 - 29.07.2011

this forward that i create ..
Quote:

Setteam(id, 0);

and it means
Quote:

if(teamid == 0)
{
gTeam[playerid] = Axis;
SetPlayerSkin(playerid, 287);
SetPlayerPos(playerid,2418.2493,110.7310,27.1995);
SetCameraBehindPlayer(playerid);
SetPlayerColor(playerid, Red);
SendClientMessage(playerid, Red, "******Russian POWERS******");
SendClientMessage(playerid, Red, "Welcome Back to base");
SendClientMessage(playerid, Red, "Please follow all Server Rules.");
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Which Type of Soldier?", "Soldier \n Medic \n Mechanic", "Done", "Close");
}

the command working at me so i dont think it's problem in the forward .
but i need that the command will affect a id of player


Re: problem in command - Famalamalam - 29.07.2011

No ... you were setting it to your own ID.

pawn Код:
Setteam(playerid, 0);
It SHOULD be:

pawn Код:
Setteam(id, 0);
Since "id" is what you enter in the command.


Re: problem in command - marik1599 - 29.07.2011

yeaaaaaaaaaaaa tnx man !!!!!
you very help me !!


Re: problem in command - Famalamalam - 29.07.2011

Lol, I'm glad.