14.04.2011, 18:16
(
Последний раз редактировалось Mister. M; 16.04.2011 в 18:57.
)
Hello World!
I just created a script, its very very easy to create but just if somebody is searching for one, here it is!
<^ Thanks the IsASweeper Function from Raven's Roleplay ^>
----
Colors:
----
----
The top:
----
--
OnPlayerExitVehicle
--
---
OnPlayerEnterVehicle
---
---
IsASweeper * Thanks to Raven's Roleplay
---
---
The Command;
---
----
Forward
-----
-----
The public function;
-----
What does it do?
* Pay's the player after 2 minutes sitting into a Sweeper.
* Works on every sweeper you'll add in the map.
* Has no bugs (Maybe some warning at Compiling.
* Doesn't need any includes, just put it in your Gamemod.
How do i get some functions?
** Thanks to Raven's Roleplay for the IsASweeper Function!
It doesnt work, now what?
** Help is always here, if you got some problems, i'll set it up for you, post it here.
Regards And Enjoy, its my first Release!
I just created a script, its very very easy to create but just if somebody is searching for one, here it is!
<^ Thanks the IsASweeper Function from Raven's Roleplay ^>
----
Colors:
----
pawn Код:
#define COLOR_RED 0xAA3333AA
#define COLOR_ORANGE 0xFF9900AA
The top:
----
pawn Код:
new PlayerIsSweeping[MAX_PLAYERS];
new idcar = GetPlayerVehicleID(playerid);
OnPlayerExitVehicle
--
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(IsASweeper(vehicleid)){
if(PlayerIsSweeping[playerid] == 1){
SendClientMessage(playerid,COLOR_RED,"You have left your job, you won't recieve the money!");
PlayerIsSweeping[playerid] = 0;
return 1;
}
}
}
OnPlayerEnterVehicle
---
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsASweeper(vehicleid)){ SendClientMessage(playerid,COLOR_ORANGE,"You can start the job using /takejob"); return 1; }
}
IsASweeper * Thanks to Raven's Roleplay
---
pawn Код:
public IsASweeper(carid)
{
new model = GetVehicleModel(carid);
if(model == 574)
{
return 1;
}
return 0;
}
The Command;
---
pawn Код:
if(!strcmp(cmdtext, "/takejob", true))
{
if(IsPlayerConnected(playerid))
{
if(IsASweeper(idcar)) {
if(PlayerIsSweeping[playerid] == 1)
{ SendClientMessage(playerid, COLOR_BLUE, "You are already sweeping the streets!"); return 1; }
new giveplayerid[128];
new string[128];
new plname[128];
SetTimerEx("Payhim", 120000, false, "i", playerid);
PlayerIsSweeping[playerid] = 1;
TogglePlayerControllable(playerid, 1);
GetPlayerName(playerid, plname, sizeof(plname));
SendClientMessage(playerid, COLOR_WHITE, "* You will recieve $400 for cleaning the streets after 2 minutes!");
format(string, sizeof(string), "* %s (%d) is now a Streetcleaner!", plname, playerid);
SendClientMessageToAll(COLOR_YELLOW, string);
}
return 1;
}
----
Forward
-----
pawn Код:
forward Payhim(playerid);
forward IsASweeper(carid);
The public function;
-----
pawn Код:
public Payhim(playerid)
{
if(PlayerIsSweeping[playerid] == 1)
{
new giveplayer[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "** %s (%d) is not a streetcleaner anymore!", giveplayer,playerid);
PlayerIsSweeping[playerid] = 0;
SendClientMessage(playerid, COLOR_RED, "You earned $400 for cleaning the streets!");
SafeGivePlayerMoney(playerid,400);
SendClientMessageToAll(COLOR_BLUE, string);
}
return 1;
}
What does it do?
* Pay's the player after 2 minutes sitting into a Sweeper.
* Works on every sweeper you'll add in the map.
* Has no bugs (Maybe some warning at Compiling.
* Doesn't need any includes, just put it in your Gamemod.
How do i get some functions?
** Thanks to Raven's Roleplay for the IsASweeper Function!
It doesnt work, now what?
** Help is always here, if you got some problems, i'll set it up for you, post it here.
Regards And Enjoy, its my first Release!