24.12.2014, 22:50
How To Make invaild Command When Admin Aduty ?
please i want example +Rep
i want made it on this command arrest
and i use this aduty
please i want example +Rep
PHP код:
CMD:arrest(playerid, params[])
{
new targetid;
if (gTeam[playerid] == TEAM_SWAT || gTeam[playerid] == TEAM_COPS || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_FBI)
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid,COLOR_ERROR,"USAGE: /Arrest (Player Name/PlayerID)");
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if(!IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z)) return SendClientMessage(playerid, COLOR_RED, "You aren't near that player.");
if(GetPlayerWantedLevel(targetid) < 4) return SendClientMessage(playerid, COLOR_RED, "That player is not wanted!");
SetPlayerInterior(targetid, 3);
new RandomG = random(sizeof(RandomSpawnCLIVINS));
SetPlayerPos(targetid, RandomSpawnJail[RandomG][0], RandomSpawnJail[RandomG][1], RandomSpawnJail[RandomG][2]);
SetPlayerFacingAngle(targetid, RandomSpawnJail[RandomG][3]);
GivePlayerMoney(playerid, 1000+random(9000));
GivePlayerMoney(targetid, 1000-random(9000));
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
SetPlayerScore(targetid, GetPlayerScore(targetid) - 1);
SetPlayerHealth(targetid, 10000000000.0);
ApplyAnimation( playerid,"ped", "ARRESTgun", 4.0, 0, 0, 0, 0, 0);
SetPlayerWantedLevel(targetid, 0);
ResetPlayerWeapons(targetid);
//Set player Bail
MoneyBail[targetid] = 4000+random(8000);
new bail[24];
format(bail, sizeof(bail), "%d $", MoneyBail[targetid]);
TextDrawSetString(JailTimer4[targetid],bail);
//Info
new b[128];
format(b, sizeof(b), "Now you are in jail! You need to pay: %i $", MoneyBail[targetid]);
SendClientMessage(targetid, -1, b);
GameTextForPlayer(targetid, "~r~Jailed~y~!", 3500, 3);
TextDrawShowForPlayer(targetid, JailTimer0[targetid]);
TextDrawShowForPlayer(targetid, JailTimer1[targetid]);
TextDrawShowForPlayer(targetid, JailTimer2[targetid]);
TextDrawShowForPlayer(targetid, JailTimer3[targetid]);
TextDrawShowForPlayer(targetid, JailTimer4[targetid]);
PlayerSeconds[targetid] = 20; //Here: 60000+random(60000);
PlayerTimer[targetid] = SetTimerEx("JailTimer",1000,true,"i",targetid);
return 1;
}
and i use this aduty
PHP код:
CMD:aduty(playerid) //Doesnt need params function
{
if(PlayerInfo[playerid][pRank] >= 1 && PlayerInfo[playerid][pRank] <= 8 || IsPlayerAdmin(playerid)) //If you use rcon admin delete (PlayerInfo[playerid][pAdmin] >=1 ||
{
if (aDuty[playerid] == 0) //Check if player is on duty
{
new string[128];
new Float:x,Float:y,Float:z;
new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_DRED,x,y,z, 40.0, 0, 0); //Creates 3d text label at player position
GetPlayerPos(playerid,x,y,z); //Looks for players position
SetPlayerHealth(playerid,999999); //makes player godmode
SetPlayerColor(playerid,COLOR_DRED); //set admin colour red
SetPlayerSkin(playerid,294); //set admin skin to 294
format(string,sizeof(string), "%s is now on Duty!",GetPlayerNameEx(playerid)); //here you format string to send to players
SendClientMessageToAll(COLOR_DRED,string); //send string to players
SendClientMessage(playerid,COLOR_DRED,"You are now on duty!"); //Tell admin he is now on duty
Attach3DTextLabelToPlayer(label,playerid,0.0, 0.0, 0.7); //attach 3d text label made before to player
aDuty[playerid] = 1; //Set player on duty
}
else if (aDuty[playerid] == 1) //Check if player is on duty
{
new string[128];
new Float:x,Float:y,Float:z;
new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_DRED,x,y,z, 40.0, 0, 0);
Delete3DTextLabel(label); //Delete 3d text label saying "Admin On Duty!"
SetPlayerHealth(playerid,100); //sets player health back to 100
format(string,sizeof(string)," %s is now off Duty!",GetPlayerNameEx(playerid)); //Format string to send to players
SendClientMessageToAll(COLOR_DRED,string); //send players string
SendClientMessage(playerid, COLOR_DRED,"You are now off duty!"); //send admin message he is off duty
aDuty[playerid] = 0; //sets admin off duty
}
}
else
SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!"); //Error message to send to players who arent admins
return 1;
}