Change class
#1

So, i have a problem blocking the player from choosing cop team if wanted.

I placed this on OnPlayerRequestSpawn:

pawn Код:
if(GetPlayerWantedLevel(playerid) >= 1 && gTeam[playerid][TEAM_COP]) return SendClientMessage(playerid, COLOR_RED, "* You can't be a Law Enforcement Officer while wanted.");
But doesn't work. Basically, i don't want players use cop team if they have a wanted level. Thanks.
Reply
#2

This code goes somewhere under OnPlayerRequestClass if I am not mistaken and it goes like
PHP код:
if(GetPlayerWantedLevel(playerid) >= && classid == TEAM_COP) return SendClientMessage(playeridCOLOR_RED"* You can't be a Law Enforcement Officer while wanted."); 
Reply
#3

Quote:
Originally Posted by iLearner
Посмотреть сообщение
This code goes somewhere under OnPlayerRequestClass if I am not mistaken and it goes like
PHP код:
if(GetPlayerWantedLevel(playerid) >= && classid == TEAM_COP) return SendClientMessage(playeridCOLOR_RED"* You can't be a Law Enforcement Officer while wanted."); 
Eh no, perchи in quel modo ogni volta che switcho classe nella selezione, mi appare quel messaggio ma posso comunque spawnarmi come poliziotto. Invece dovrebbe andare su OnPlayerRequestSpawn in modo da bloccarlo, ma non so come. :S
Reply
#4

return 0 dovrebbe aiutarti.

Se non funziona aspetta che arrivo a casa e telo dick per bene.
Reply
#5

Provato, non funziona. Bisogna fare come ho detto io..
Reply
#6

Bump.
Reply
#7

Show whole code
Reply
#8

Whole code of what?
Reply
#9

PHP код:
if(GetPlayerWantedLevel(playerid) < 1) return SendClientMessage(playeridCOLOR_RED"* You can't be a Law Enforcement Officer while wanted."); 
use this directly to get know the wanted level of the player and make the classid == gteam[playerid][cop]
so it can give the message only for cop teams
Reply
#10

Your wanted level check must be > 1.

Also, where do i have to place that code?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)