/eject fail - ID 0 gets ejected too -
Striker_Moe - 18.09.2009
Код:
if(!strcmp(cmd, "/eject", true))
{
new Float:pX,Float:pY,Float:pZ;
SendPlayerFormattedText(playerid,":::::::::::::::::::::::::::::::::::::::::::::::",0);
SendClientMessage(playerid, COLOR_YELLOW , "EMERGENCY EXIT activated");
SendPlayerFormattedText(playerid,":::::::::::::::::::::::::::::::::::::::::::::::",0);
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[!] %s used emergency exit (/eject) to outrun death. [!]", name );
SendClientMessageToAll(RED, string);
GetPlayerPos(giveplayerid,pX,pY,pZ);
SetPlayerPos(giveplayerid,pX,pY,pZ+10);
GivePlayerWeapon(playerid, 46, 1);
return 1;
}
Whats wrong here? If someone uses /eject, ID 0 gets slapped too..
Re: /eject fail - ID 0 gets ejected too -
[HiC]TheKiller - 18.09.2009
Is giveplayerid defined or is it set to the default of 0?
Re: /eject fail - ID 0 gets ejected too -
Striker_Moe - 18.09.2009
Dont know..
Re: /eject fail - ID 0 gets ejected too -
[HiC]TheKiller - 18.09.2009
Quote:
Originally Posted by Mo3
Dont know..
|
What is the giveplayerid for in that script?
Re: /eject fail - ID 0 gets ejected too -
Correlli - 18.09.2009
I don't see 'giveplayerid' defined anywhere, so it means it's 0 and there is your problem.
Re: /eject fail - ID 0 gets ejected too -
Blades - 18.09.2009
Use
sscanf for this, really easy.
Re: /eject fail - ID 0 gets ejected too -
Sznupek - 18.09.2009
Quote:
Originally Posted by Don Correlli
I don't see 'giveplayerid' defined anywhere, so it means it's 0 and there is your problem.
|
Yes, it's equal the default value of 0, so always player with ID 0 is ejected
Exchange it for
playerid
Re: /eject fail - ID 0 gets ejected too -
Correlli - 18.09.2009
Quote:
Originally Posted by Sznupek
You have this variable in 12. line of your code
It's equal 0 (and always player with ID 0 is ejected), because probably, you haven't assigned any other value to it
Exchange it for playerid
|
And what in your post is different from mine? I said the same thing.
Quote:
Originally Posted by Sznupek
You have this variable in 12. line of your code
|
It's not defined as "other player id".
Re: /eject fail - ID 0 gets ejected too -
Karlip - 18.09.2009
He doesn't want /eject [id], he wants to eject themselves.
Change the 'giveplayerid' to 'playerid'.
Re: /eject fail - ID 0 gets ejected too -
Sznupek - 18.09.2009
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Sznupek
You have this variable in 12. line of your code
It's equal 0 (and always player with ID 0 is ejected), because probably, you haven't assigned any other value to it
Exchange it for playerid
|
And what in your post is different from mine? I said the same thing.
|
I didn't read your post carefully and thought you're the founder of the therad
I noticed it after my reply, so I modified my first post to something sensible since I can't delete it, sorry
Yea?
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Sznupek
You have this variable in 12. line of your code
|
It's not defined as "other player id".
|
I've not written it