Smail Help
#1

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
Reply
#2

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]);
Reply
#3

thanks but the format not message i rape him
Reply
#4

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.
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)