How to fix? - 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 fix? (
/showthread.php?tid=286332)
How to fix? -
Super_Panda - 28.09.2011
pawn Код:
CMD:onduty(playerid, params [])
{
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_WHITE, "You are not admin!");
{
new name[MAX_PLAYER_NAME];
new string[100];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Admin %s is now admin on duty!",name); return SendClientMessage(playerid, COLOR_WHITE, "You are already on duty");
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
Re: How to fix? -
Jack_Leslie - 28.09.2011
How to fix what, what's the problem? Don't post a code without telling us what you want us to do, moron.
Re: How to fix? -
Dripac - 28.09.2011
Do you get errors? If so please post them
Re: How to fix? -
Super_Panda - 28.09.2011
I cannot get in-game that when im on duty and I do it again it doesnt sends the message "You are already on duty"
Re: How to fix? -
Dragony92 - 28.09.2011
pawn Код:
new OnDuty[MAX_PLAYERS];
CMD:onduty(playerid, params [])
{
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_WHITE, "You are not admin!");
if(OnDuty[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "You are already on duty");
{
new name[MAX_PLAYER_NAME];
new string[100];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Admin %s is now admin on duty!",name);
SendClientMessage(playerid, COLOR_WHITE, string);
OnDuty[playerid] = 1;
}
return 1;
}