SA-MP Forums Archive
how to SendClientMessage if player is cop and try to rob - 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: how to SendClientMessage if player is cop and try to rob (/showthread.php?tid=650304)



how to SendClientMessage if player is cop and try to rob - Jithu - 25.02.2018

I have made Checkpoint robbery, not actor robbery system, so i need help with this!if the cop is trying to rob how can we stop ..!

I have used:

if(gTeam == TEAM_COP)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are not allowed to rob while you are in cop");
}

It shows errors ...

So, i want someone could reply in this topic..i want to create robbery places in whole place , san andreas, san fierro, las venturas, bayside....!

can someone help me from this?


Re: how to SendClientMessage if player is cop and try to rob - Jithu - 25.02.2018

oh i forget, i have used this code.. I dont want cop let rob the stores
http://forum.sa-mp.com/showthread.ph...l+make+robbery


Re: how to SendClientMessage if player is cop and try to rob - RxErT - 25.02.2018

PHP код:
#define SendClientMessage SCM
public OnPlayerEnterDynamicCP(playeridcheckpointid
{
    if(
gTeam == TEAM_ROBBER)
    {
    if(
checkpointid == CP_tatoo) return SCM(playerid, -1"{f59f95}Type {F45f95}/robstore {f59f95}to start a robbery!");
    }
    else
    {
    if(
gTeam == TEAM_COP) return SCM(playerid, -1,"{f00f00}[ERROR] {FFFFFF}You aren't able to rob because you're a LEO!");
    }
    return 
1;
}

I didn't tested it, but hopefully it's right.

EDITED!!


Re: how to SendClientMessage if player is cop and try to rob - Jithu - 25.02.2018

Thanks , hope this will work, + rep if works


Re: how to SendClientMessage if player is cop and try to rob - RxErT - 25.02.2018

Quote:
Originally Posted by Jithu
Посмотреть сообщение
Thanks , hope this will work, + rep if works
Check the reply above i fixed some little issues.


Re: how to SendClientMessage if player is cop and try to rob - Jithu - 26.02.2018

oh thanks, let me check it


Re: how to SendClientMessage if player is cop and try to rob - Jithu - 26.02.2018

it should be #define SendClientMessage SCM

then

if(gTeam == TEAM_ROBBER)
{
if(checkpointid == CP_tatoo) return SCM(playerid, -1, "{f59f95}Type {F45f95}/robstore {f59f95}to start a robbery!");
}
else
{
if(gTeam == TEAM_COP) return SCM(playerid, -1,"{f00f00}[ERROR] {FFFFFF}You aren't able to rob because you're a LEO!");
}


Re: how to SendClientMessage if player is cop and try to rob - DobbysGamertag - 26.02.2018

Holy shit. Why in gods name are you redefining SendClientMessage(); as SCM?

Your gTeam needs to be global since it looks like you're using it as an indication of the players team (i feel you've copied and pasted this from somewhere. You've used hungarian notation yet, you're not using it globally).

pawn Код:
new gTeam[MAX_PLAYERS];
Under where you're setting the team:

pawn Код:
gTeam[playerid] = some_team_id;
Team checking:
pawn Код:
if(gTeam[playerid] == someval)