Lower Wanted Level
#1

Hello, I wanted a code that every 5 minutes the player loses one wantedlevel.
Reply
#2

pawn Код:
SetTimerEx("wantedtimer", 1000*60*5, true, "i", playerid);
..
forward wantedtimer(playerid);
public wantedtimer(playerid)
{
if(GetPlayerWantedLevel) >= 1)
{
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) - 1);
}
}
Should work
Reply
#3

I pasted at the end of my GM

Quote:

forward wantedtimer(playerid);

SetTimerEx("wantedtimer", 1000*60*5, true, "i", playerid);

public wantedtimer(playerid)
{
if(GetPlayerWantedLevel) >= 1)
{
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) - 1);
}
}

He took a few errors.

Quote:

C:\Users\Daniel\Desktop\Servidor de Gta\gamemodes\BHL.pwn(50645) : error 021: symbol already defined: "SetTimerEx"
C:\Users\Daniel\Desktop\Servidor de Gta\gamemodes\BHL.pwn(50649) : error 076: syntax error in the expression, or invalid function call
C:\Users\Daniel\Desktop\Servidor de Gta\gamemodes\BHL.pwn(50649) : error 029: invalid expression, assumed zero
C:\Users\Daniel\Desktop\Servidor de Gta\gamemodes\BHL.pwn(50649) : warning 215: expression has no effect
C:\Users\Daniel\Desktop\Servidor de Gta\gamemodes\BHL.pwn(50649) : error 001: expected token: ";", but found ")"
C:\Users\Daniel\Desktop\Servidor de Gta\gamemodes\BHL.pwn(50649) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Reply
#4

Well you have to use the SetTimerEx somewhere inside a function, let's say when you get a wanted level by robbing someone, set the timer
Reply
#5

This way?
PS: I want to remove the independent action he had before
Quote:

public LWantedLevel ( )
{
for ( new playerid = 0; playerid < MAX_PLAYERS; playerid ++ )
{
if ( IsPlayerConnected ( playerid ) )
{
if ( GetPlayerWantedLevel ( playerid ) > 1 && GetPlayerWantedLevel ( playerid ) < 6 )
{
SetPlayerWantedLevel ( playerid , GetPlayerWantedLevel ( playerid ) - 1 );
{
SetTimerEx("LWantedLevel", 10*6*5, true, "i", playerid);
}
}
}
}
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)