SA-MP Forums Archive
/rape 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: /rape problem (/showthread.php?tid=313841)



/rape problem - Face9000 - 27.01.2012

This command is writed to rape other near players:

pawn Код:
CMD:rape(playerid, params[])
{
    if(IsPlayerNearPlayer(playerid, 5.0)){
    SendClientMessage(playerid, COLOR_WHITE, "Raped player.");
    return 1;
    }else{
    SendClientMessage(playerid, COLOR_WHITE, "You are NOT near a player so you can't attemp to rape him.");
    return 1;
    if(gTeam[playerid] == TEAM_COP) return SendClientMessage(playerid, red, "Cops can't rape other players!");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You can't rape a player if you are in a vehicle!");
    if(IsSpawned[playerid] == 0) return SendClientMessage(playerid,0xFF0000FF,"You can't use this command when you are dead or spawning.");
    if(GetPVarInt(playerid,"RapeTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"Please wait 10 seconds before rape again.");
    SetPVarInt(playerid,"RapeTime",GetTickCount()+10000);
    return true;
}
Function:

pawn Код:
forward IsPlayerNearPlayer(playerid, n_playerid, Float:radius);
pawn Код:
IsPlayerNearPlayer(playerid, n_playerid, Float:radius){
    new Float:npx, Float:npy, Float:npz;
    GetPlayerPos(n_playerid, npx, npy, npz);
    if(IsPlayerInRangeOfPoint(playerid, radius, npx, npy, npz)){
        return true;
    }else{
        return false;
    }
}
When i compile i got tons of errors not releated to the code,what's wrong in that command?


Re: /rape problem - Face9000 - 27.01.2012

Tag mismatch:

pawn Код:
if(IsPlayerNearPlayer(playerid, 5.0))
Thank you.


Re: /rape problem - milanosie - 27.01.2012

why would you make /rape...

thats just wrong


Re: /rape problem - Face9000 - 27.01.2012

Quote:
Originally Posted by milanosie
Посмотреть сообщение
why would you make /rape...

thats just wrong
It's a cops&robbers gamemode,and the /rape command is for civilians team...


Re: /rape problem - Face9000 - 27.01.2012

Nope,i get tag mismatch here:

pawn Код:
if(IsPlayerNearPlayer(playerid, 5.0))



Re: /rape problem - Abreezy - 27.01.2012

IsPlayerNearPlayer(playerid, n_playerid, Float:radius){

Which means you need 2 of the playerids,

so...
pawn Код:
if(IsPlayerNearPlayer(playerid, n_playerid, 5.0))



Re: /rape problem - Silentfood - 27.01.2012

pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "You are NOT near a player so you can't attemp to rape him.");
Shouldn't it be:
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "You are NOT near a player so you can't attemp to rape him/her.");



Re: /rape problem - Face9000 - 27.01.2012

"undefined symbol "n_playerid""

epic.

I just need,when player uses /rape,it rape the closest player,not a specified id.


Re: /rape problem - Abreezy - 27.01.2012

It's your function lol. That's what you had in the function. Give me a few minutes to re-read the whole code.


Re: /rape problem - Face9000 - 27.01.2012

Quote:
Originally Posted by Abreezy
Посмотреть сообщение
It's your function lol. That's what you had in the function. Give me a few minutes to re-read the whole code.
Yeah i know but it's strange,lol.Every function i make is not giving me problems,only these