how to SendClientMessage if player is cop and try to rob
#1

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?
Reply
#2

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
Reply
#3

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!!
Reply
#4

Thanks , hope this will work, + rep if works
Reply
#5

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

oh thanks, let me check it
Reply
#7

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!");
}
Reply
#8

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)