15.08.2012, 07:27
Hi. how i can make 2function on 1 command ?exemple
1 command for Admin and GameMaster(Player+)
command /on
When i am a admin and i write /on to Show "Admin BLABLA is on duty"
When i am a GameMaste to show "GameMAster blabla is on duty"
I have this but when i am a admin and write /on shows
"Admin blabla is on duty"
"GameMaster blabla is on duty"
why ?
here is the command
1 command for Admin and GameMaster(Player+)
command /on
When i am a admin and i write /on to Show "Admin BLABLA is on duty"
When i am a GameMaste to show "GameMAster blabla is on duty"
I have this but when i am a admin and write /on shows
"Admin blabla is on duty"
"GameMaster blabla is on duty"
why ?
here is the command
pawn Код:
//------------------------------------------------------------------------------
if (strcmp(cmd,"/on",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
new sMsg[ 128 ];
GetPlayerName( playerid, sMsg, MAX_PLAYER_NAME );
SetPlayerColor(playerid, COLOR_GROVE);
SetPlayerArmour(playerid, 10000.0);
SetPlayerHealth(playerid, 10000.0);
format( sMsg, sizeof( sMsg ), "(GC)Admin %s e na dolznost.", sMsg );
SendClientMessageToAll(COLOR_LIGHTRED, sMsg);
SetPlayerAttachedObject(playerid, 3, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
OnDuty[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "{FF4040}GRESKA:{FFFFFF}Ne ste Ovlasteni za ovaa Komanda.");
return 1;
}
if (PlayerInfo[playerid][pGameMaster] >= 1 || PlayerInfo[playerid][pGameMaster] <= 3)
{
new sMsg[ 128 ];
GetPlayerName( playerid, sMsg, MAX_PLAYER_NAME );
SetPlayerColor(playerid, COLOR_DBLUE);
SetPlayerArmour(playerid, 10000.0);
SetPlayerHealth(playerid, 10000.0);
format( sMsg, sizeof( sMsg ), "(GC)GameMaster %s e na dolznost.", sMsg );
SendClientMessageToAll(COLOR_LIGHTRED, sMsg);
SetPlayerAttachedObject(playerid, 3, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
OnDuty[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "{FF4040}GRESKA:{FFFFFF}Ne ste Ovlasteni za ovaa Komanda.");
return 1;
}
}
return 1;
}