SA-MP Forums Archive
Smail Help - 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: Smail Help (/showthread.php?tid=552818)



Smail Help - sas10 - 26.12.2014

Hello Guys
The /cure Commands Not KillTimer Rape
PHP код:
forward Rape2(playerid);
public 
Rape2(playerid)
{
    
GetPlayerHealth(playerid,health);
    
SetPlayerHealth(playerid,health-7);
    return 
1;

PHP код:
CMD:rape(playeridparams[])
{
    new 
targetid;
    if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_RED"[USAGE]: /rape [Part of Name/Player ID]");
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(targetidxyz);
    if(
IsPlayerInRangeOfPoint(playerid5.0xyz)) {
    new 
string[500];
    new 
target[MAX_PLAYER_NAME];
    
GetPlayerName(targetidtargetsizeof(target));
    
format(stringsizeof(string), "INFO: You have rape %s!",target);
    
PlayerTimer[targetid] = SetTimerEx("Rape2",3000,true,"i",targetid); }
    else 
SendClientMessage(playeridCOLOR_RED"Your message here if player is not near target!");
    return 
1;

PHP код:
CMD:cure(playeridparams[])
{
    new 
targetid;
    if(
sscanf(params"u"targetid)) return SendClientMessage(playeridCOLOR_RED"[USAGE]: /cure [Part of Name/Player ID]");
    
KillTimer(PlayerTimer[playerid]);
    return 
1;

and some time its rape all server
please help me at cure to killtimer rape and fixing the rape all server bug +rep for helped


Re: Smail Help - Write - 26.12.2014

pawn Код:
CMD:cure(playerid, params[])
{
    new targetid;
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /cure [Part of Name/Player ID]");
    KillTimer(PlayerTimer[playerid]);
    return 1;
}
You put playerid KillTimer(PlayerTimer[playerid]); here which would be curing your own playerid but up there you set "targetid" meaning you should put it here aswell otherwise the command woulden't do anything for the specificed player.

So you change KillTimer(PlayerTimer[playerid]);

to

KillTimer(PlayerTimer[targetid]);


Re: Smail Help - sas10 - 26.12.2014

thanks but the format not message i rape him


Re: Smail Help - jonrb - 26.12.2014

Your Rape2 function needs to have the 'health' variable created. To do this, add
Код:
new Float:health;
just before the GetPlayerHealth and SetPlayerHealth.

I don't know if that is what you mean so please elaborate on the problem if you can.


Re: Smail Help - sas10 - 26.12.2014

Quote:
Originally Posted by jonrb
Посмотреть сообщение
Your Rape2 function needs to have the 'health' variable created. To do this, add
Код:
new Float:health;
just before the GetPlayerHealth and SetPlayerHealth.

I don't know if that is what you mean so please elaborate on the problem if you can.
dude i have it