05.11.2010, 21:51
Quote:
Hi , i`m searching for a script that can make a new job , Prison Guard ,
i want that job to have some commands: /on ( Makes the player on duty and teleports him at the prison ) /off ( Makes the player off duty and teleports him to his house / normal spawn place ) /Weapons ( Only when he`s on duty : gives him a sniper and a M4a1 ) /Alert [playername/id] ( Announces the server that a prissoner has escaped ) And also if possible , at payday , depending on how many minutes he guarded the prison to get a amount of money 10 minutes = 10.000 $ 20 minutes = 20.000 $ 30 minutes = 40.000 $ 50 minutes = 50.000 $ If possible please help me please Thank You |
Requirements:
DCMD, sscanf
A bit PAWN knowledge
To do:
Add the follow lines below OnPlayerCommandText:
Code:
dcmd(on, 2, cmdtext); dcmd(off, 3, cmdtext); dcmd(weapons, 7, cmdtext); dcmd(alert, 5, cmdtext);
pawn Code:
dcmd_on(playerid, params[])
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are now a Prison Guard");
SetPlayerPos(playerid, prisonx, prisony, prisonz);
SetPVarInt(playerid, "Guard", 1);
}
dcmd_off(playerid, params[])
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are no longer a Prison Guard");
SpawnPlayer(playerid);
SetPVarInt(playerid, "Guard", 0);
}
dcmd_weapons(playerid, params[])
{
if(!(GetPVarInt(playerid, "Guard") == 1)) return SendClientMessage(playerid, 0xFFFFFFFF, "Sorry, you must be a Prison Guard if you want weapons");
SendClientMessage(playerid, 0xFFFFFFFF, "[PRISON]: You have received 250 sniper bullets and 1500 M4 bullets");
GivePlayerWeapon(playerid, 31, 1500);
GivePlayerWeapon(playerid, 34, 250);
}
dcmd_alert(playerid, params[])
{
new id;
if(sscanf("u", id)) SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /alert [playername/id]");
else
{
GameTextForAll("~w~A ~r~prisoner ~w~is escapped!", 3000, 3);
}
}