ID's 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)
+--- Thread: ID's problem (
/showthread.php?tid=462344)
ID's problem -
RandomDude - 06.09.2013
pawn Код:
dcmd_rape(playerid, params[])
{
new ID = strval(params);
if(GetClosestPlayerToPlayer(playerid,ID) > RAPE_DISTANCE) return SendClientMessage(playerid, RED, "No One Close Enough To Rape.");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, RED, "That player is not connected!");
if(ID == playerid) return SendClientMessage(playerid, RED, "You cannot rape yourself!");
if(rapespam[playerid] == 0)
{
if(GetDistanceBetweenPlayers(playerid,ID) > RAPE_DISTANCE) return SendClientMessage(playerid, RED, "You Are Not Close Enough To Rape The Player.");
if(GetClosestPlayerToPlayer(playerid,ID) > RAPE_DISTANCE) return SendClientMessage(playerid, RED, "No One Close Enough To Rape.");
Me and my friend testing bugs and shit we came across this...
Basically I joined first I can /ra without ID and it rapes closest player
But when he /ra without ID it tells him he cannot rape himself ... -.- I don't seem to understand...
pawn Код:
if(ID == playerid) return SendClientMessage(playerid, RED, "You cannot rape yourself!");
Re: ID's problem -
RandomDude - 06.09.2013
........................
Re: ID's problem -
Dragonsaurus - 06.09.2013
pawn Код:
dcmd_rape(playerid, params[])
{
if(!strlen(params)) return SendClientMessage(playerid, RED, "Usage: /rape [Player ID]");
new ID = strval(params);
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, RED, "That player is not connected!");
if(ID == playerid) return SendClientMessage(playerid, RED, "You cannot rape yourself!");
if(GetClosestPlayerToPlayer(playerid,ID) > RAPE_DISTANCE) return SendClientMessage(playerid, RED, "No One Close Enough To Rape.");
if(rapespam[playerid] == 0)
{
if(GetDistanceBetweenPlayers(playerid,ID) > RAPE_DISTANCE) return SendClientMessage(playerid, RED, "You Are Not Close Enough To Rape The Player.");
if(GetClosestPlayerToPlayer(playerid,ID) > RAPE_DISTANCE) return SendClientMessage(playerid, RED, "No One Close Enough To Rape.");
}
// Other code you have here...
return 1;
}