Error on PlayerStateChange
#1

Hey,

I'm trying to add a system when a civilian enters an enforcement vehicle, their wanted level will go up by 2 and a message will come up. It adds two stars to their wanted level, I'm also trying to send a message to the player telling them their new wanted level. But I get this error:

Код:
(1899) : warning 202: number of arguments does not match definition
And here is line 1899,

pawn Код:
SendClientMessage(playerid, INFO, "[WANTED LEVEL] Wanted level %s - Stealing an Enforcement vehicle!", GetPlayerWantedLevel(playerid) + 2);
Could someone help me?

Thanks
Reply
#2

pawn Код:
format(string, sizeof(string), "[WANTED LEVEL] Wanted level %s - Stealing an Enforcement vehicle!", GetPlayerWantedLevel(playerid) + 2);
SendClientMessage(playerid, INFO, string);
I'm sure that's right.
Reply
#3

pawn Код:
new string[128];
format(string, sizeof(string), "[WANTED LEVEL] Wanted level %s - Stealing an Enforcement vehicle!", GetPlayerWantedLevel(playerid) + 2);
SendClientMessage(playerid, INFO, string);
Reply
#4

Quote:
Originally Posted by JamesCaptGeneral
Посмотреть сообщение
pawn Код:
format(string, sizeof(string), "[WANTED LEVEL] Wanted level %s - Stealing an Enforcement vehicle!", GetPlayerWantedLevel(playerid) + 2);
SendClientMessage(playerid, INFO, string);
I'm sure that's right.
No errors, but in game it comes up as,

Код:
 Wanted level unday - Stealing an Enforcement vehicle!
Unday?
Reply
#5

PHP код:
SendClientMessage(playerid, -1"[WANTED LEVEL] Wanted level %s - Stealing an Enforcement vehicle!"GetPlayerWantedLevel(playerid) + 2); 
Reply
#6

Quote:
Originally Posted by FunnyBear
Посмотреть сообщение
No errors, but in game it comes up as,

Код:
 Wanted level unday - Stealing an Enforcement vehicle!
Unday?
Hmm, check your wanted level code?
Reply
#7

Lol, it's because the wanted level is an integer and not a string.

pawn Код:
new string[128];
format(string, sizeof(string), "[WANTED LEVEL] Wanted level %d - Stealing an Enforcement vehicle!", GetPlayerWantedLevel(playerid) + 2);
SendClientMessage(playerid, INFO, string);
Reply
#8

Quote:
Originally Posted by AlphaPac
Посмотреть сообщение
Lol, it's because the wanted level is an integer and not a string.

pawn Код:
new string[128];
format(string, sizeof(string), "[WANTED LEVEL] Wanted level %d - Stealing an Enforcement vehicle!", GetPlayerWantedLevel(playerid) + 2);
SendClientMessage(playerid, INFO, string);
Ah, YES! I forgot about that.
Reply
#9

Quote:
Originally Posted by AlphaPac
Посмотреть сообщение
Lol, it's because the wanted level is an integer and not a string.

pawn Код:
new string[128];
format(string, sizeof(string), "[WANTED LEVEL] Wanted level %d - Stealing an Enforcement vehicle!", GetPlayerWantedLevel(playerid) + 2);
SendClientMessage(playerid, INFO, string);
Thanks, it works!

But, is there a way so that it only adds the wanted level after 30 seconds. For example, if I get in the ambulance, it will add 2+ to my wanted level right away, but if I get out for 10 seconds and get back in, my wanted level would stay the same. It would have to be 30 seconds to a minute before its able to add the wanted level

Thanks
Reply
#10

Add the following to where the player enters the vehicles you don't want them in.
pawn Код:
SetTimerEx("wantedtimer",30000,false,"i",playerid);
then add this somewhere else:
pawn Код:
forward wantedtimer(playerid);
public wantedtimer(playerid)
{
    new string[128];
    format(string, sizeof(string), "[WANTED LEVEL] Wanted level %d - Stealing an Enforcement vehicle!", GetPlayerWantedLevel(playerid) + 2);
    SendClientMessage(playerid, INFO, string);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)