rendered paste body#include <a_samp>
#include <dutils>
#include <dini>
main()
{
print("\n----------------------------------");
print(" Code Testing by Ali");
print("----------------------------------\n");
}
enum JobsEnum
{
jTitle[256],
jPay,
jDescrip[256],
jMaker,
jInUse
}
new Jobs[][JobsEnum];
public OnGameModeInit()
{
print("GameModeInit()");
SetGameModeText("Code Testing");
new LoadSkins[] = {
0, 7, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 43, 44, 45, 46, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64,
66, 67, 68, 69, 70, 71, 72, 73,
75, 76, 77, 78, 79, 80, 81, 82,
83, 84, 85, 87, 88, 89, 90, 91,
92, 93, 94, 95, 96, 97, 98, 99,
100, 101, 102, 103, 104, 105,
106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117,
118, 120, 121, 122, 123, 124,
125, 126, 127, 128, 129, 130,
131, 132, 133, 134, 135, 136,
137, 138, 139, 140, 141, 142,
143, 144, 145, 146, 147, 148,
150, 151, 152, 153, 154, 155,
156, 157, 158, 159, 160, 161,
162, 163, 164, 165, 166, 167,
168, 169, 170, 171, 172, 173,
174, 175, 176, 177, 178, 179,
180, 181, 182, 183, 184, 185,
186, 187, 188, 189, 190, 191,
192, 193, 194, 195, 196, 197,
198, 199, 200, 201, 202, 203,
204, 205, 206, 207, 209, 210,
211, 212, 213, 214, 215, 216,
217, 218, 219, 220, 221, 222,
223, 224, 225, 226, 227, 228,
229, 230, 231, 232, 233, 234,
235, 236, 237, 238, 239, 240,
241, 242, 243, 244, 245, 246,
247, 248, 249, 250, 251, 252,
253, 254, 255, 290, 291, 292,
293, 294, 295, 296, 297, 298,
299
};
for (new i; i < sizeof(LoadSkins); i++)
{
AddPlayerClass(LoadSkins[i], 1958.3783, 1343.1572, 15.3746, 269.1425, 22, 3000, 31, 3000, 32, 3000);
}
//--------------------------Pickups--------------------------//
AddStaticPickup(370, 2, 2031.0907,1338.4077,10.8203); // jetpack
AddStaticPickup(1240, 2, 2023.5238,1338.1635,10.8203); // health
AddStaticPickup(1242, 2, 2031.2104,1346.2709,10.8203); // armour
//--------------------------Spawn Cars--------------------------//
AddStaticVehicle(411,2023.5308,1334.5774,10.1466,270.5545,0,0); // Black Infernus - Spawn
AddStaticVehicle(411,2021.9280,1351.7144,9.9506,269.4601,0,0); // Black Infernus - Spawn
AddStaticVehicle(560,2032.0262,1329.8737,10.5258,311.3071,0,0); // Black Sultan - Spawn
AddStaticVehicle(560,2031.6089,1358.3645,10.5251,220.7157,0,0); // Black Sultan - Spawn
AddStaticVehicle(602,2027.2617,1329.9399,10.5253,315.6829,0,0); // Black Alpha - Spawn
AddStaticVehicle(602,2027.2075,1356.5769,10.5255,215.7004,0,0); // Black Alpha - Spawn
AddStaticVehicle(592,1477.2406,1248.1947,10.6262,0.9756,0,0); // Andromeda
AddStaticVehicle(411,2002.3323,1544.4202,13.3141,270.3050,0,0); // Black Infernus
AddStaticVehicle(411,2432.1184,1562.2325,10.4708,359.8570,0,0); // Black Infernus
AddStaticVehicle(411,2383.9868,1778.4109,10.4709,93.1311,0,0); // Black Infernus
AddStaticVehicle(411,2154.9912,1953.3461,10.3990,0.0915,0,0); // Black Infernus
AddStaticVehicle(411,2154.7939,2202.8865,10.3990,0.0261,0,0); // Black Infernus
AddStaticVehicle(411,2089.4521,2207.0007,10.5474,181.3335,0,0); // Black Infernus
AddStaticVehicle(411,1711.6814,2258.3472,10.5474,270.9300,0,0); // Black Infernus
AddStaticVehicle(411,1534.3262,2214.4028,10.5474,180.9206,0,0); // Black Infernus
AddStaticVehicle(411,1372.8302,2011.7813,10.9077,90.5890,0,0); // Black Infernus
AddStaticVehicle(411,1512.8772,1999.4934,10.5474,179.9436,0,0); // Black Infernus
AddStaticVehicle(411,1600.1185,1839.5483,10.5474,180.2976,0,0); // Black Infernus
AddStaticVehicle(411,1706.7603,1434.9009,10.3596,179.0247,0,0); // Black Infernus
AddStaticVehicle(411,2039.4781,1071.7966,10.3989,179.2368,0,0); // Black Infernus
AddStaticVehicle(411,2173.2424,1120.9221,12.3483,332.6398,0,0); // Black Infernus
AddStaticVehicle(411,2452.3638,1240.0322,10.5474,1.2582,0,0); // Black Infernus
AddStaticVehicle(411,2489.6328,1407.9973,10.5474,178.9131,0,0); // Black Infernus
AddStaticVehicle(411,2488.0881,1532.9193,10.4731,49.3365,0,0); // Black Infernus
AddStaticVehicle(411,2591.0447,1856.3821,10.5474,270.2286,0,0); // Black Infernus
AddStaticVehicle(411,2599.1423,1681.5332,10.5474,270.6079,0,0); // Black Infernus
AddStaticVehicle(411,2360.9153,1994.5872,10.3987,358.7874,0,0); // Black Infernus
AddStaticVehicle(411,2360.7896,2214.1719,10.4076,1.0911,0,0); // Black Infernus
AddStaticVehicle(411,2623.7500,2206.2979,10.5474,180.0092,0,0); // Black Infernus
AddStaticVehicle(411,2593.0552,2275.5100,10.5474,89.9927,0,0); // Black Infernus
AddStaticVehicle(411,2879.4023,2342.2673,10.5474,90.6389,0,0); // Black Infernus
AddStaticVehicle(411,1975.2076,2657.8181,10.5545,0.0759,0,0); // Black Infernus
AddStaticVehicle(411,1959.7941,2755.3193,10.5474,0.7571,0,0); // Black Infernus
AddStaticVehicle(400,1465.0983,-902.2777,54.9283,180.4395,113,1); // Black Infernus
AddStaticVehicle(400,2019.8120,-1076.7189,24.6951,247.8014,113,1); // Black Infernus
AddStaticVehicle(603,2205.9595,-1164.9965,25.5691,89.9563,75,77); // Black Infernus
AddStaticVehicle(603,2390.4971,-1717.7861,13.4419,0.9855,75,77); // Black Infernus
AddStaticVehicle(415,1886.2029,2339.5566,10.6016,269.2250,0,1); // Black Infernus
AddStaticVehicle(411,-255.6057,2765.9688,62.0906,180.9327,0,0); // Black Infernus
AddStaticVehicle(411,-201.5001,2595.1074,62.3999,180.4964,0,0); // Black Infernus
AddStaticVehicle(411,-234.3362,2608.4287,62.3873,0.2706,0,0); // Black Infernus
AddStaticVehicle(411,-784.9832,2752.6523,45.3305,87.1844,0,0); // Black Infernus
AddStaticVehicle(411,-878.0573,2757.3979,45.5339,94.4374,0,0); // Black Infernus
AddStaticVehicle(411,-1275.9562,2705.6831,49.7590,208.4528,0,0); // Black Infernus
AddStaticVehicle(411,-1400.2727,2643.7561,55.3724,268.7715,0,0); // Black Infernus
AddStaticVehicle(411,-1522.4243,2525.4658,55.4240,180.1596,0,0); // Black Infernus
AddStaticVehicle(411,-1936.6404,2383.5608,49.1771,111.5292,0,0); // Black Infernus
set(Jobs[0][jTitle],"Testing");
Jobs[0][jPay] = 10000;
set(Jobs[0][jDescrip],"You are testing in the correct direction");
Jobs[0][jMaker] = 0;
Jobs[0][jInUse] = 1;
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerFacingAngle(playerid, 50.1425);
printf("OnPlayerRequestClass(%d, %d)", playerid, classid);
SetPlayerPos(playerid, 1961.8290,1593.4952,75.7188);
SetPlayerCameraPos(playerid, 1960.2369,1594.1226,76.8727);
SetPlayerCameraLookAt(playerid, 1961.8290,1593.4952,75.7188);
return 1;
}
public OnGameModeExit()
{
print("GameModeExit()");
return 1;
}
public OnPlayerConnect(playerid)
{
printf("OnPlayerConnect(%d)", playerid);
GameTextForPlayer(playerid, "~b~ Code Testing ~n~ by Ali", 6000, 1);
return 1;
}
public OnPlayerDisconnect(playerid)
{
printf("OnPlayerDisconnect(%d)", playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
printf("OnPlayerSpawn(%d)", playerid);
GivePlayerMoney(playerid, 100000);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
printf("OnPlayerDeath(%d, %d, %d)", playerid, killerid, reason);
return 1;
}
public OnPlayerText(playerid)
{
printf("OnPlayerText(%d)", playerid);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
SetTimer("ScoreUpdate", 1000, 1);
new help[256], helpindex;
help = strtok(cmdtext, helpindex);
if (strcmp(help, "/help", true) ==0)
{
SendPmMsg(playerid, "Hello and welcome to Ali's Code Testing server!");
SendPmMsg(playerid, "This server is being used by me to learn how to code Pawn, the language");
SendPmMsg(playerid, "used to make scripts for SA-MP");
SendPmMsg(playerid, "----------------------------------");
SendPmMsg(playerid, "Type: /rules for the server rules");
SendPmMsg(playerid, " /commands for a list of commands");
SendPmMsg(playerid, "----------------------------------");
SendPmMsg(playerid, "That's it for now, but hopefully more coming soon!");
SendPmMsg(playerid, "----------------------------------");
return 1;
}
new rules[256], rulesindex;
rules = strtok(cmdtext, rulesindex);
if (strcmp(rules, "/rules", true) ==0)
{
SendPmMsg(playerid, "Here is a list of all the rules in this server, don't obey");
SendPmMsg(playerid, "them and you will be punished");
SendPmMsg(playerid, "----------------------------------");
SendPmMsg(playerid, "No Deathmatching");
SendPmMsg(playerid, "No cheats or hacks of any kind");
SendPmMsg(playerid, "No offensive comments");
SendPmMsg(playerid, "Be respectful to other players");
SendPmMsg(playerid, "be respectful to admins");
SendPmMsg(playerid, "----------------------------------");
return 1;
}
new commands[256], commandsindex;
commands = strtok(cmdtext, commandsindex);
if (strcmp(commands, "/commands", true) ==0)
{
SendPmMsg(playerid, "Commands List 1");
SendPmMsg(playerid, "/help - See the help menu");
SendPmMsg(playerid, "/giveweapon - Gives you or another player a weapon");
SendPmMsg(playerid, "/sethealth - Sets the health of you or another player");
SendPmMsg(playerid, "/up - raises you up by the defined distance");
SendPmMsg(playerid, "/teleport - teleports you to the specified player");
SendPmMsg(playerid, "/goto - CMoves you to a predefined location");
SendPmMsg(playerid, "Type /commands2 for the second list");
return 1;
}
new commands2[256], commands2index;
commands2 = strtok(cmdtext, commands2index);
if (strcmp(commands2, "/commands2", true) ==0)
{
SendPmMsg(playerid, "Commands List 2");
SendPmMsg(playerid, "/remove - removes the player from their vehicle");
SendPmMsg(playerid, "/home - brings you back to the spawnpoint");
SendPmMsg(playerid, "/disarm - to disarm a player");
SendPmMsg(playerid, "/givecash - to givecash to a player");
SendPmMsg(playerid, "/pm - send a private message to another player");
SendPmMsg(playerid, "/worldtime - to change the time of the map");
SendPmMsg(playerid, "Type /commands 3 for the third commands list");
return 1;
}
new commands3[256], commands3index;
commands3 = strtok(cmdtext, commands3index);
if (strcmp(commands2, "/commands3", true) ==0)
{
SendPmMsg(playerid, "Commands List 3");
SendPmMsg(playerid, "/inter - to change your interior");
SendPmMsg(playerid, "/setcolor - to set your player color");
SendPmMsg(playerid, "/admincash - to give yourself cash (Rcon admin only)");
return 1;
}
new upcmd[256], upindex;
upcmd = strtok(cmdtext, upindex);
if (strcmp(upcmd, "/up", true)==0)
{
new upnum[256];
upnum = strtok(cmdtext, upindex);
if(!strlen(upnum)){
SendErrMsg(playerid, "Usage: /up <Amount to go up by>");
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SendInfMsg(playerid, "You are moved up");
SetPlayerPos(playerid, x, y, z + strval(upnum));
return 1;
}
new wcmd[256], windex;
wcmd = strtok(cmdtext, windex);
if (strcmp(wcmd, "/giveweapon", true) ==0)
{
new wplayer, weap, ammo;
wplayer = strval(strtok(cmdtext, windex));
weap = strval(strtok(cmdtext, windex));
ammo = strval(strtok(cmdtext, windex));
GivePlayerWeapon(wplayer, weap, ammo);
new wname[MAX_WEAPON_NAME];
GetWeaponName(weap, wname, MAX_WEAPON_NAME);
new string[256];
format(string, sizeof(string),"Your have recieved a %s with %d ammo", wname, ammo );
SendInfMsg(wplayer, string);
return 1;
}
new healthcmd[256], hindex;
healthcmd = strtok(cmdtext, hindex);
if (strcmp(healthcmd, "/sethealth", true) ==0)
{
new hplayer, health;
hplayer = strval(strtok(cmdtext, hindex));
health = strval(strtok(cmdtext, hindex));
if (health > 100){
SendErrMsg(playerid, "Number must be between 0 and 100!");
}
else
{
SetPlayerHealth(hplayer, health);
new string[256];
format(string, sizeof(string),"Your health has been changed to %d", health);
SendInfMsg(hplayer, string);
}
return 1;
}
new teleport[256], teleportindex;
teleport = strtok(cmdtext, teleportindex);
if (strcmp(teleport, "/teleport", true) ==0)
{
new teleid;
teleid = strval(strtok(cmdtext, teleportindex));
new Float:x, Float:y, Float:z;
GetPlayerPos(teleid, x, y, z);
SetPlayerPos(playerid, x, y, z + 4);
new telename[MAX_PLAYER_NAME];
GetPlayerName(teleid, telename, MAX_PLAYER_NAME);
new string[256];
format(string, sizeof(string),"Your health has been teleported to %s", telename);
SendInfMsg(playerid, string);
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
new string2[256];
format(string2, sizeof(string2),"%s has teleported to you", playername);
SendInfMsg(teleid, string2);
return 1;
}
new gethealth[256], gethealthindex;
gethealth = strtok(cmdtext, gethealthindex);
if (strcmp(gethealth, "/gethealth", true) ==0)
{
new gethealthid, Float:health;
gethealthid = strval(strtok(cmdtext, gethealthindex));
GetPlayerHealth(gethealthid, Float:health);
new healthname[MAX_PLAYER_NAME];
GetPlayerName(gethealthid, healthname, MAX_PLAYER_NAME);
new string[256];
format(string, sizeof(string),"The health of %s is %d", healthname, Float:health);
SendInfMsg(playerid, string);
return 1;
}
new gotocmd[256], gotoindex;
gotocmd = strtok(cmdtext, gotoindex);
if (strcmp(gotocmd, "/goto", true) ==0)
{
new gotonum;
gotonum = strval(strtok(cmdtext, gotoindex));
if (gotonum == 1)
{
SetPlayerInterior(playerid, 10);
SetPlayerPos(playerid, 1886.2029,2339.5566,10.6016);
SetPlayerFacingAngle(playerid, 90);
SendInfMsg(playerid, "You are teleported");
}
if (gotonum == 2)
{
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, -2158.6337,642.5574,1057.5937);
SetPlayerFacingAngle(playerid, 38);
SendInfMsg(playerid, "You are teleported");
}
if (gotonum == 3)
{
SetPlayerInterior(playerid, 17);
SetPlayerPos(playerid, -958.0768,1944.5648,9.0000);
SetPlayerFacingAngle(playerid, 195);
SendInfMsg(playerid, "You are teleported");
}
if (gotonum == 4)
{
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, -784.2230,504.6317,1371.7421);
SetPlayerFacingAngle(playerid, 177);
SendInfMsg(playerid, "You are teleported");
}
if (gotonum == 5)
{
SetPlayerInterior(playerid, 12);
SetPlayerPos(playerid, 2324.4277,-1146.4155,1050.7100);
SetPlayerFacingAngle(playerid, 360);
SendInfMsg(playerid, "You are teleported");
}
if (gotonum == 6)
{
SetPlayerInterior(playerid, 7);
SetPlayerPos(playerid, -1395.6573,-201.3375,1051.3872);
SetPlayerFacingAngle(playerid, 260);
SendInfMsg(playerid, "You are teleported");
}
if (gotonum == 7)
{
SetPlayerInterior(playerid, 4);
SetPlayerPos(playerid, -1428.4804,-662.6060,1060.1972);
SetPlayerFacingAngle(playerid, 56);
SendInfMsg(playerid, "You are teleported");
}
if (gotonum == 8)
{
SetPlayerInterior(playerid, 14);
SetPlayerPos(playerid, -1486.8618,1642.1459,1060.6718);
SetPlayerFacingAngle(playerid, 225);
SendInfMsg(playerid, "You are teleported");
}
return 1;
}
new subgotocmd1[256], subgoto1index;
subgotocmd1 = strtok(cmdtext, subgoto1index);
if (strcmp(subgotocmd1, "/gotolist1", true) ==0)
{
SendInfMsg(playerid, "1. RC Battle Room");
SendInfMsg(playerid, "2. Wuzi's Place");
SendInfMsg(playerid, "3. Dam Generator Room");
SendInfMsg(playerid, "4. Saint Marco's Bistro");
SendInfMsg(playerid, "5. Admin House");
SendInfMsg(playerid, "6. Racing Stadium");
SendInfMsg(playerid, "7. Dirtbike Stadium");
SendInfMsg(playerid, "8. KickStart Stadium");
SendInfMsg(playerid, "Type /gotolist2 for list 2");
return 1;
}
new remove[256], rindex;
remove = strtok(cmdtext, rindex);
if (strcmp(remove, "/remove", true) ==0)
{
new rplayer;
rplayer = strval(strtok(cmdtext, rindex));
RemovePlayerFromVehicle(rplayer);
new rname[MAX_PLAYER_NAME];
GetPlayerName(rplayer, rname, MAX_PLAYER_NAME);
new string[256];
format(string, sizeof(string),"%s is no longer in a vehicle", rname);
SendInfMsg(playerid, string);
return 1;
}
new skincmd[256], skinindex;
skincmd = strtok(cmdtext, skinindex);
if (strcmp(skincmd, "/skin", true) ==0)
{
new skin;
skin = strval(strtok(cmdtext, skinindex));
SetPlayerSkin(playerid, skin);
new string[256];
format(string, sizeof(string),"Your skin has been changed to skin %d", skin);
SendInfMsg(playerid, string);
return 1;
}
new homecmd[256], homeindex;
homecmd = strtok(cmdtext, homeindex);
if (strcmp(homecmd, "/home", true) ==0)
{
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, 2040.1792,1342.6342,10.6719);
SendInfMsg(playerid, "You are home");
return 1;
}
new pmcmd[256], pmindex;
pmcmd = strtok(cmdtext, pmindex);
if(strcmp(pmcmd, "/pm", true) ==0)
{
new pmid, pmmsg[256];
pmid = strval(strtok(cmdtext, pmindex));
pmmsg[25] = strval(strtok(cmdtext, pmindex));
new string[256];
format(string, sizeof(string),"PM from %s: %s",pmid, pmmsg);
SendPmMsg(pmid, string);
new pmname[MAX_PLAYER_NAME];
GetPlayerName(pmid, pmname, MAX_PLAYER_NAME);
new string2[256];
format(string2, sizeof(string2),"PM sent to %s", pmname);
SendInfMsg(playerid, string2);
return 1;
}
new intercmd[256], intindex;
intercmd = strtok(cmdtext, intindex);
if (strcmp(intercmd, "/inter", true) == 0)
{
new inter;
inter = strval(strtok(cmdtext, intindex));
SetPlayerInterior(playerid, inter);
SendInfMsg(playerid, "You have changed interiors");
return 1;
}
new worldtime[256], wtindex;
worldtime = strtok(cmdtext, wtindex);
if (strcmp(worldtime, "/worldtime", true) ==0)
{
new time;
time = strval(strtok(cmdtext, wtindex));
if (time > 24){
SendErrMsg(playerid, "Time must be between 0 and 24!");
}
else
{
SetWorldTime(time);
}
return 1;
}
new setcolour[256], setcolourindex;
setcolour = strtok(cmdtext, setcolourindex);
if (strcmp(setcolour, "/setcolor", true) ==0)
{
new setplayerid, colourid;
setplayerid = strval(strtok(cmdtext, setcolourindex));
colourid = strval(strtok(cmdtext, setcolourindex));
SetPlayerColor(setplayerid, colourid);
new colourname[MAX_PLAYER_NAME];
GetPlayerName(setplayerid, colourname, MAX_PLAYER_NAME);
new string[256];
format(string, sizeof(string),"%s has had their player color changed", colourname);
SendInfMsg(playerid, string);
SendInfMsg(setplayerid, "Your player color has been changed");
return 1;
}
new command[256], index;
command = strtok(cmdtext, index);
if(strcmp(command, "/givecash", true) == 0)
{
new from, to, amount;
from = playerid;
to = strval(strtok(cmdtext, index));
amount = strval(strtok(cmdtext, index));
if (to < 0 || amount <= 0 || !IsPlayerConnected(to))
{
SendClientMessage(playerid,0xAA3333AA,"Usage: /givecash <ID> <Amount>");
return 1;
}
if (amount > GetPlayerMoney(from))
{
SendClientMessage(playerid,0xAA3333AA,"You don't have enough money to do this.");
return 1;
}
GivePlayerMoney(from, 0 - amount);
GivePlayerMoney(to, amount);
SendClientMessage(from,0xFFFF00AA,"You gave money away to someone");
SendClientMessage(to,0xFFFF00AA,"You got money from someone");
return 1;
}
if(strcmp(command, "/admincash", true) == 0 && IsPlayerAdmin(playerid))
{
new money;
money = strval(strtok(cmdtext, index));
if (money == 0)
{
SendClientMessage(playerid,0xFFFF00AA, "STUPID FUCK HOW AM I SUPPOSED TO GIVE YOU NOTHING");
}
GivePlayerMoney(playerid, money);
return 1;
}
if(strcmp(command, "/jobs", true) == 0)
{
new subcommand[256];
subcommand = strtok(cmdtext, index);
if(!strlen(subcommand)) {
SendErrMsg(playerid, "Usage: /jobs [add/list/apply/del]");
return 1;
}
else
if(strcmp(subcommand, "add", true) == 0)
{
subcommand = strtok(cmdtext, index);
new Maker, Title[256], Pay, Descrip[256];
if(!strlen(subcommand)) {
SendErrMsg(playerid, "Usage: /jobs add [Title] [Pay] [Description]");
Maker = playerid;
Title[10] = strval(strtok(cmdtext, index));
Pay = strval(strtok(cmdtext, index));
Descrip[10] = strval(strtok(cmdtext, index));
return 1;
}
SendInfMsg(playerid, "Your job has been added");
return 1;
}
else
if(strcmp(subcommand, "list", true) == 0) {
SendInfMsg(playerid, "-------------Jobs List-------------");
subcommand = strtok(cmdtext, index);
new Maker, Title[256], Pay, Descrip[256];
Maker = playerid;
Title[10] = strval(strtok(cmdtext, index));
Pay = strval(strtok(cmdtext, index));
Descrip[10] = strval(strtok(cmdtext, index));
for (new i; Jobs[i][jInUse] == 1; i++) {
new string[256];
format(string, sizeof(string),"Title = %s, Pay is $%d, Description = %s, Employer = %s",Jobs[i][jTitle],Jobs[i][jPay],Jobs[i][jDescrip],Jobs[i][jMaker]);
SendInfMsg(playerid, string);
}
return 1;
}
//else
//if(strcmp(subcommand, "apply", true) == 0) {
//subcommand = strtok(cmdtext, index);
//new Maker;
//Maker = playerid;
//if(!strlen(subcommand))
//SendErrMsg(playerid, "Usage: /jobs apply <Employer ID>");
//return 1;
//}
//SendInfMsg(playerid, "Your application has been sent");
//return 1;
//}
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
printf("OnPlayerEnterVehicle(%d, %d, %d)", playerid, vehicleid, ispassenger);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
printf("OnPlayerExitVehicle(%d, %d)", playerid, vehicleid);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
printf("OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
printf("OnPlayerEnterCheckpoint(%d)", playerid);
SetPlayerCheckpoint(playerid,2020.8119,1338.3542,10.8203 , 10);
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
printf("OnPlayerLeaveCheckpoint(%d)", playerid);
return 1;
}
SendErrMsg(playerid, message[])
{
new string[256];
format(string, sizeof(string), "* %s",message);
SendClientMessage(playerid,0xAA3333AA,string);
return 1;
}
public ScoreUpdate()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
new Score; Score = GetPlayerMoney(i);
SetPlayerScore(i, Score);
}
}
}
SendInfMsg(playerid, message[])
{
new string[256];
format(string, sizeof(string), "* %s",message);
SendClientMessage(playerid,0x299637C8,string);
return 1;
}
SendPmMsg(playerid, message[])
{
new string[256];
format(string, sizeof(string), "* %s",message);
SendClientMessage(playerid,0xFFFF00FF,string);
return 1;
}