Change class - 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: Change class (
/showthread.php?tid=657793)
Change class -
KinderClans - 15.08.2018
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.
Re: Change class -
iLearner - 15.08.2018
This code goes somewhere under OnPlayerRequestClass if I am not mistaken and it goes like
PHP код:
if(GetPlayerWantedLevel(playerid) >= 1 && classid == TEAM_COP) return SendClientMessage(playerid, COLOR_RED, "* You can't be a Law Enforcement Officer while wanted.");
Re: Change class -
KinderClans - 15.08.2018
Quote:
Originally Posted by iLearner
This code goes somewhere under OnPlayerRequestClass if I am not mistaken and it goes like
PHP код:
if(GetPlayerWantedLevel(playerid) >= 1 && classid == TEAM_COP) return SendClientMessage(playerid, COLOR_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
Re: Change class -
iLearner - 15.08.2018
return 0 dovrebbe aiutarti.
Se non funziona aspetta che arrivo a casa e telo dick per bene.
Re: Change class -
KinderClans - 15.08.2018
Provato, non funziona. Bisogna fare come ho detto io..
Re: Change class -
KinderClans - 16.08.2018
Bump.
Re: Change class -
Shinja - 16.08.2018
Show whole code
Re: Change class -
KinderClans - 17.08.2018
Whole code of what?
Re: Change class -
CaptainBoi - 18.08.2018
PHP код:
if(GetPlayerWantedLevel(playerid) < 1) return SendClientMessage(playerid, COLOR_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
Re: Change class -
KinderClans - 18.08.2018
Your wanted level check must be > 1.
Also, where do i have to place that code?