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(playerid, checkpointid)
{
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).
Under where you're setting the team:
pawn Код:
gTeam[playerid] = some_team_id;
Team checking:
pawn Код:
if(gTeam[playerid] == someval)