PDA

View Full Version : Help with Saving Player Position(dini)


ricardo178
24/03/2011, 01:50 PM
Hey guys, i have been around 1 hour trying to save player pos and load it when player login but can't... My code is here, if someone can make me thjis favour and make it save i will be really thanks!
Thanks

Here's the code:


#include <a_samp>
#include <dini>
#include <dudb>
#include <zcmd>
#include <sscanf>

#pragma unused ret_memcpy

new IsLogged[MAX_PLAYERS];
new file[256];
new bool:ismuted[MAX_PLAYERS];



enum pInfo
{
AdminLevel,
Cash,
Score,
Color,
Job,
Vw,
Int,
Warns,
}
new PlayerInfo[MAX_PLAYERS][pInfo];

//-------------------------------Admin Commands---------------------------------
COMMAND:makeadmin(playerid, params[])
{
new id;
new AdminLevel2;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 1338 || IsPlayerAdmin(playerid))
{
if(!sscanf(params, "ui", id, AdminLevel2))
{
if((AdminLevel2 >= 101 && AdminLevel2 <= 106) || AdminLevel2 == 1338 || AdminLevel2 == 0)
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s Has Given You %d Admin Level.", name, AdminLevel2);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Gave %d Admin Level To %s .", AdminLevel2, PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
PlayerInfo[id][AdminLevel] = AdminLevel2;
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "Avaliable Levels: 101, 102, 103, 104, 105, 106, 1338");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You Need Rcon Admin To Use This Command!");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Connected");
}
COMMAND:setjob(playerid, params[])
{
new id;
new Job1;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 106)
{
if(!sscanf(params, "ui", id, Job1))
{
if((Job1 >= 1 && Job1 <= 10) || Job1 == 0)
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s Has Given You %d Job.", name, Job1);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Gave %d Job To %s .", Job1, PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
PlayerInfo[id][Job] = Job1;
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "Avaliable Levels: 1(cop), 2(medic), 3(taxi), 4(mechanic), 5, 6, 7, 8, 9, 10");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /setjob [PlayerId/PartOfName] [Job]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You Need Rcon Admin To Use This Command!");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Connected");
}
COMMAND:ah1(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 101)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Admin Painel||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Level 101: /freeze /unfreeze /setint /setvw /spawnplayer");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not admin");
}
COMMAND:ah2(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 102)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Admin Painel||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Level 101: /freeze /unfreeze /setint /setvw /spawnplayer");
SendClientMessage(playerid, 0xFF00CC, "Level 102: /kick /warn1 /warn2 /warn3 /warn4 /warn5");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not admin");
}
COMMAND:ah3(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 103)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Admin Painel||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Level 101: /freeze /unfreeze /setint /setvw /spawnplayer");
SendClientMessage(playerid, 0xFF00CC, "Level 102: /kick /warn1 /warn2 /warn3 /warn4 /warn5");
SendClientMessage(playerid, 0xFF00CC, "Level 103: /money /score");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not admin");
}
COMMAND:ah4(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 104)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Admin Painel||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Level 101: /freeze /unfreeze /setint /setvw /spawnplayer");
SendClientMessage(playerid, 0xFF00CC, "Level 102: /kick /warn1 /warn2 /warn3 /warn4 /warn5");
SendClientMessage(playerid, 0xFF00CC, "Level 103: /money /score");
SendClientMessage(playerid, 0xFF00CC, "Level 104: /ban /sethp /setarmour");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not admin");
}
COMMAND:ah5(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 105)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Admin Painel||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Level 101: /freeze /unfreeze /setint /setvw /spawnplayer");
SendClientMessage(playerid, 0xFF00CC, "Level 102: /kick /warn1 /warn2 /warn3 /warn4 /warn5");
SendClientMessage(playerid, 0xFF00CC, "Level 103: /money /score");
SendClientMessage(playerid, 0xFF00CC, "Level 104: /ban /sethp /setarmour");
SendClientMessage(playerid, 0xFF00CC, "Level 105: /goto /gethere /kill /vr /spawncar");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not admin");
}
COMMAND:ah6(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 106)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Admin Painel||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Level 101: /freeze /unfreeze /setint /setvw /spawnplayer");
SendClientMessage(playerid, 0xFF00CC, "Level 102: /kick /warn1 /warn2 /warn3 /warn4 /warn5");
SendClientMessage(playerid, 0xFF00CC, "Level 103: /money /score");
SendClientMessage(playerid, 0xFF00CC, "Level 104: /ban /sethp /setarmour");
SendClientMessage(playerid, 0xFF00CC, "Level 105: /goto /gethere /kill /vr /spawncar");
SendClientMessage(playerid, 0xFF00CC, "Level 106: /ajail /aunjail /setjob /giveweapon");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not admin");
}
COMMAND:ah1338(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 1338)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Admin Painel||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Level 101: /freeze /unfreeze /setint /setvw /spawnplayer");
SendClientMessage(playerid, 0xFF00CC, "Level 102: /kick /warn1 /warn2 /warn3 /warn4 /warn5");
SendClientMessage(playerid, 0xFF00CC, "Level 103: /money /score");
SendClientMessage(playerid, 0xFF00CC, "Level 104: /ban /sethp /setarmour");
SendClientMessage(playerid, 0xFF00CC, "Level 105: /goto /gethere /kill /vr /spawncar");
SendClientMessage(playerid, 0xFF00CC, "Level 106: /ajail /aunjail /setjob /giveweapon");
SendClientMessage(playerid, 0xFF00CC, "Level 1338: /makeadmin");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not admin");
}
COMMAND:medichelp(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 2)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Medic Commands||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Commands: /health");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not medic.");
}
COMMAND:mechanichelp(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 3)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Mechanic Commands||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Commands: /repair");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not mechanic.");
}
COMMAND:taxihelp(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 4)
{
SendClientMessage(playerid, 0xFF00CC, "||--------------------------||Taxi Commands||-------------------------||");
SendClientMessage(playerid, 0xFF00CC, "Commands: /taxifare");
SendClientMessage(playerid, 0xFF00CC, "||-----------------------||By Ricardo Manuel||-----------------------||");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not taxi driver.");
}
COMMAND:stats(playerid, params[])
{
new string[64];
format(string, sizeof(string), "Money: %d ||Level: %d ||AdminLevel: %d ||Job: %d ", GetPlayerMoney(playerid), GetPlayerScore(playerid), PlayerInfo[playerid][AdminLevel], PlayerInfo[playerid][Job]);
SendClientMessage(playerid, 0xFF00CC, string);
return 1;
}
COMMAND:money(playerid, params[])
{
new id;
new ammount;
if(IsPlayerConnected(id))
{
if(PlayerInfo[id][AdminLevel] >= 103)
{
if(!sscanf(params, "ui", id, ammount))
{
if(ammount <= 10000000000)
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s Has Given You %d.", name, ammount);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Gave %d Money To %s .", ammount, PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
GivePlayerMoney(id, ammount);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You can't give so much");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rmoney [PlayerId/PartOfName] [Ammount]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not admin 1338");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:freeze(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 101)
{
new id;
if(!sscanf(params, "u", id))
{
if(IsPlayerConnected(id))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if(IsPlayerInRangeOfPoint(id, 20.0, X,Y,Z))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You Have Been Freezed By %s", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Freezed %s", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
TogglePlayerControllable(id, 0);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You Are Not Near The Player.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Conected.");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rfreeze [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
COMMAND:unfreeze(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >=101)
{
new id;
if(!sscanf(params, "u", id))
{
if(IsPlayerConnected(id))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if(IsPlayerInRangeOfPoint(id, 20.0, X,Y,Z))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You Have Been UnFreezed By %s", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You UnFreezed %s", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
TogglePlayerControllable(id, 1);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You Are Not Near The Player.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Conected.");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /runfreeze [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
COMMAND:ban(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 104)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You Have Been Banned By %s.", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Banned %s .", id);
SendClientMessage(playerid, 0xFF00CC, string);
Ban(id);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rban [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:kick(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 102)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You Have Been Kicked By %s.", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Kicked %s .", id);
SendClientMessage(playerid, 0xFF00CC, string);
Kick(id);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rkick [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:score(playerid, params[])
{
new id;
new score;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 103)
{
if(!sscanf(params, "ui", id, score))
{
if(score <= 1000)
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Your Score Has Been Setted To %d By %s.", score, name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Setted %s Score To %d.", PlayerName, score);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerScore(id, score);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You can't set more than 1000");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rscore [PlayerId/PartOfName] [Score]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:goto(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 105)
{
if(!sscanf(params, "ui", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z; GetPlayerPos(id,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(id));
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s teleported his self to you", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You teleported yourself to %s .", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWor ld(id));
SetPlayerPos(playerid,x+2,y,z);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rgoto [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:gethere(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 105)
{
if(!sscanf(params, "ui", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerInterior(id,GetPlayerInterior(playerid));
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s teleported yourself to him.", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You teleported %s to you.", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerVirtualWorld(id,GetPlayerVirtualWorld(pla yerid));
SetPlayerPos(id,x+2,y,z);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rgethere[PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:kill(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 105)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been killed by %s.", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You killed %s .", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerHealth(id, 0);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rkill [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:vr(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][AdminLevel] >= 105)
{
if(IsPlayerInAnyVehicle(playerid))
{
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, 0xFF00CC, "Vehicle Repaired.");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not in any vehicle");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:sethp(playerid, params[])
{
new id;
new hp;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 103)
{
if(!sscanf(params, "ui", id, hp))
{
if(hp <= 100)
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Your Health Has Been Setted To %d By %s.", hp, name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Setted %s Health To %d.", PlayerName, hp);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerHealth(id, hp);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You can't set more than 100");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rsethp [PlayerId/PartOfName] [Hp]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:setarmour(playerid, params[])
{
new id;
new armour;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 103)
{
if(!sscanf(params, "ui", id, armour))
{
if(armour <= 100)
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Your Armour Has Been Setted To %d By %s.", armour, name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Setted %s Armour To %d.", PlayerName, armour);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerArmour(id, armour);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You can't set more than 100");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rsetarmour [PlayerId/PartOfName] [Armour]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:ajail(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 106)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been jailed by %s.", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You jailed %s .", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerPos(id, 264.6288,77.5742,1001.0391);
SetPlayerInterior(id, 3);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rjail [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:aunjail(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 106)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been unjailed by %s.", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You unjailed %s .", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerPos(id, 1555.097900, -1675.848754, 16.195312);
SetPlayerInterior(id, 0);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /runjail [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:mute(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 105)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been muted by %s.", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You muted %s .", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
ismuted[id] = true;
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /rmute [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:unmute(playerid, params[])
{
new id;
if(PlayerInfo[playerid][AdminLevel] >= 105)
{
if(IsPlayerAdmin(playerid))
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been unmuted by %s.", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You unmuted %s .", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
ismuted[id] = false;
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /runmute [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:setint(playerid, params[])
{
new id;
new interior;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 101)
{
if(!sscanf(params, "ui", id, interior))
{
if(interior <= 100)
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Your Interior Has Been Setted To %d By %s.", interior, name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Setted %s Interior To %d.", PlayerName, interior);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerInterior(id, interior);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "Invalid Interior Id");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /setint [PlayerId/PartOfName] [Interior]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:setvw(playerid, params[])
{
new id;
new virtualworld;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 101)
{
if(!sscanf(params, "ui", id, virtualworld))
{
if(virtualworld <= 100)
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Your Virtual World Has Been Setted To %d By %s.", virtualworld, name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Setted %s Virtual World To %d.", PlayerName, virtualworld);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerVirtualWorld(id, virtualworld);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "Invalid Virtual World Id");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /setvw [PlayerId/PartOfName] [VirtualWorld]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:giveweapon(playerid, params[])
{
new id;
new weap;
new ammo;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 106)
{
if(!sscanf(params, "uii", id, weap, ammo))
{
if(weap >= 1 && weap <= 46)
{
if(ammo >= 1 && ammo <= 5000)
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s has given You weapon %d with %d ammu.", name, weap, ammo);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You gave weapon %d with %d ammu to %s .", weap, ammo, PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
GivePlayerWeapon(id, weap, ammo);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "Max. Ammo is 5000");
}
else return SendClientMessage(playerid, 0xFF00CC, "Invalid weapon id!");

}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /giveweapon[PlayerId/PartOfName] [WeaponId] [Ammo]"),
SendClientMessage(playerid, 0xFF00CC, "1(Brass) 2(Nite) 3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 9(Chainsaw) 10-13(Dildo)"),
SendClientMessage(playerid, 0xFF00CC, "14(Flowers) 15(Cane) 16(Grenades) 17(Teargas) 18(Molotovs) 22(Pistol) 23(SPistol) 24(Eagle)"),
SendClientMessage(playerid, 0xFF00CC, "25(Shotgun) 26(sawn-off) 27(Combat) 28(TEC9) 29(MP5) 30(AK47) 31(M4) 32(MAC10) 33(Country)"),
SendClientMessage(playerid, 0xFF00CC, "34(Sniper) 35(RPG) 37(Flamethrower) 38(Minigun) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
}
else return SendClientMessage(playerid, 0xFF00CC, "You Need Rcon Admin To Use This Command!");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Connected");
}
COMMAND:warn1(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 102)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been warned by %s ", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You have warn %s ", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
PlayerInfo[playerid][Warns] = 1;
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /warn1 [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:warn2(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 102)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been warned by %s ", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You have warn %s ", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
PlayerInfo[playerid][Warns] = 2;
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /warn2 [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:warn3(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 102)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been warned by %s ", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You have warn %s ", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
PlayerInfo[playerid][Warns] = 3;
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /warn3 [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:warn4(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 102)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been warned by %s ", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You have warn %s ", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
PlayerInfo[playerid][Warns] = 4;
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /warn4 [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:warn5(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 102)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been warned by %s ", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You have warn %s ", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
PlayerInfo[playerid][Warns] = 5;
Kick(playerid);
SendClientMessage(playerid, 0xFF00CC, "Account blocked for max.(5) warns reached.");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /warn5 [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:spawncar(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 105)
{
new carid, carcolor1, carcolor2;
if(!sscanf(params, "iii", carid, carcolor1, carcolor2))
{
if(carid >= 400 && carid <= 611)
{
if(carcolor1 >= 0 && carcolor1 <= 252)
{
if(carcolor2 >= 0 && carcolor2 <= 252)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateVehicle(carid, X, Y, Z+(2), 10, carcolor1, carcolor2, 100);
SendClientMessage(playerid, 0xFF00CC, "Vehicle Spawned");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "Only color id's between 0 and 252 are avaliable.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Only color id's between 0 and 252 are avaliable.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Only id's between 400 and 611 are avaliable.");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /spawncar [VehicleId] [Color 1][Color 2]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
COMMAND:spawnplayer(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 101)
{
new id;
if(!sscanf(params, "u", id))
{
if(IsPlayerConnected(id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You have been spawned by %s ", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You have spawn %s ", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
SpawnPlayer(id);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /spawnplayer [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command");
}
//------------------------------------Job Commands------------------------------
COMMAND:health(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 2)
{
new id;
if(!sscanf(params, "u", id))
{
if(IsPlayerConnected(id))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if(IsPlayerInRangeOfPoint(id, 20.0, X,Y,Z))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "You Have Been Healthed By %s", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You Healthed %s", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerHealth(id, 100);
GivePlayerMoney(id, -1000);
GivePlayerMoney(playerid, 1000);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You Are Not Near The Player.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Conected.");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /health [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not medic.");
}
COMMAND:repair(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][Job] == 4)
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Your car has been repaired by %s for 100$.", name);
SendClientMessage(id, 0xFF00CC, string);
format(string, sizeof(string), "You repaired %s vehicled for 100$.", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
RepairVehicle(GetPlayerVehicleID(id));
GivePlayerMoney(id, -100);
GivePlayerMoney(playerid, 100);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /repair [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player is not connected.");
}
COMMAND:taxifare(playerid, params[])
{
new string[64];
new name[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][Job] == 4)
{
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Taxi driver %s on duty, /pm if you need him", name);
SendClientMessageToAll(0xFF00CC, string);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not taxi driver.");
}
//------------------------------------------------------------------------------
//----------------------------------Cop Commands--------------------------------
new jailed[MAX_PLAYERS];
forward UnJail();


COMMAND:duty(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1555.097900, -1675.848754, 16.195312))
{
SetPlayerColor(playerid, 0xFF00CC);
SendClientMessage(playerid, 0xFF00CC, "You Are Now A Cop, Use /equip To Get Weapons.");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You Are Not In LSPD Entrance.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Only cops can duty!");
}

COMMAND:dutyoff(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 1)
{
if(IsPlayerConnected(playerid))
{
SetPlayerColor(playerid, 0xFFFFFFAA);
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, 0xFF00CC, "You Are Now Off Duty.");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Online");
}
else return SendClientMessage(playerid, 0xFF00CC, "Only Cops Can Use This Command.");
}

COMMAND:equip(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 1)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1555.097900, -1675.848754, 16.195312))
{
GivePlayerWeapon(playerid, 24, 1000);
GivePlayerWeapon(playerid, 25, 1000);
GivePlayerWeapon(playerid, 29, 1000);
GivePlayerWeapon(playerid, 31, 1000);
GivePlayerWeapon(playerid, 34, 1000);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You Are Not At LSPD Entrance.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Online");
}
else return SendClientMessage(playerid, 0xFF00CC, "Only Cops Can Use This Command.");
}

COMMAND:stun(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 1)
{
new toplayer;
if(!sscanf(params, "ui", toplayer))
{
if(IsPlayerConnected(toplayer))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if(IsPlayerInRangeOfPoint(toplayer, 20.0, X,Y,Z))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(toplayer, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Cop %s Has Stun You", name);
SendClientMessage(playerid, 0xFF00CC, string);
format(string, sizeof(string), "You Has Stun %s", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
TogglePlayerControllable(toplayer, 0);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You Are Not Near The Player.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Conected.");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /stun [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "Only Cops Can Use This Command.");
}
COMMAND:unstun(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 1)
{
new toplayer;
if(!sscanf(params, "ui", toplayer))
{
if(IsPlayerConnected(toplayer))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if(IsPlayerInRangeOfPoint(toplayer, 20.0, X,Y,Z))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(toplayer, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Cop %s Has UnStun You", name);
SendClientMessage(playerid, 0xFF00CC, string);
format(string, sizeof(string), "You Has UnStun %s", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
TogglePlayerControllable(toplayer, 1);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You Are Not Near The Player.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Conected.");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /unstun [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFF00CC, "Only Cops Can Use This Command.");
}
COMMAND:cjail(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 1)
{
new toplayer;
if(!sscanf(params, "ui", toplayer))
{
if(IsPlayerConnected(toplayer))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if(IsPlayerInRangeOfPoint(toplayer, 20.0, X,Y,Z))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(toplayer, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Cop %s Jailed You For 3 Minutes.", name);
SendClientMessage(playerid, 0xFF00CC, string);
format(string, sizeof(string), "You Jailed %s", PlayerName);
SendClientMessage(playerid, 0xFF00CC, string);
SetPlayerPos(toplayer, 264.6288,77.5742,1001.0391);
SetPlayerInterior(toplayer, 6);
jailed[toplayer] = 1;
SetTimer("UnJail",180000,false);
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "You Are Not Near The Player.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Player Is Not Connected.");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /cjail [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0x0259, "You Are Not Cop!");
}
COMMAND:cophelp(playerid, params[])
{
if(PlayerInfo[playerid][Job] == 1)
{
SendClientMessage(playerid, 0xFF00CC, "||-------->>>>Cop Commands<<<<--------||");
SendClientMessage(playerid, 0xFF00CC, "Duty: Use /duty in LSPD entrance to duty.");
SendClientMessage(playerid, 0xFF00CC, "Cop Cmds: /dutyoff, /equip, /stun /unstun, /cjail(this command jail for 3 minuts with automatic unjail)");
SendClientMessage(playerid, 0xFF00CC, "LSPD Cmds: /pdo1 /pdc1 /pdo2 /pdc2 /pdo3 /pdc3");
return 1;

}
else return SendClientMessage(playerid, 0xFF00CC, "You are not cop!");
}

//------------------------------------------------------------------------------
public UnJail()
{
for(new v; v < MAX_PLAYERS; v++)
{
if(jailed[v] == 1)
{
SetPlayerPos(v, 1555.097900, -1675.848754, 16.195312);
SetPlayerInterior(v, 0);
jailed[v] = 0;
}
return 1;
}
return 1;
}
public OnPlayerText(playerid, text[])
{
if(ismuted[playerid])
{
SendClientMessage(playerid, 0xFF00CC, "You are muted");
return 0;
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
new name[24];
GetPlayerName(playerid,name,24);
format(file,sizeof(file),"RicAdmin/users/%s.ini",name);
if(dini_Exists(file))
{
dini_IntSet(file,"Cash",GetPlayerMoney(playerid));
dini_IntSet(file,"Score",GetPlayerScore(playerid));
dini_IntSet(file,"Color",GetPlayerColor(playerid));
dini_IntSet(file,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
dini_IntSet(file,"Job",PlayerInfo[playerid][Job]);
dini_IntSet(file,"Vw",GetPlayerVirtualWorld(playerid));
dini_IntSet(file,"Int",GetPlayerInterior(playerid));
dini_IntSet(file,"Warns",PlayerInfo[playerid][Warns]);
IsLogged[playerid] = 0;
return 1;
}
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
IsLogged[playerid] = 0;
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "RicAdmin/users/%s.ini", name);
if (!dini_Exists(file))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Hi your not registered", "Welcome, your not registered mate, put your registration password below.", "Register", "Leave");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "You are registred, put your password below.", "Login", "Leave");
}
if(PlayerInfo[playerid][Warns] == 5)
{
SendClientMessage(playerid, 0xFF00CC, "Your account is blocked for max. warns(5) reached, apply on forums to unblock your account.");
Kick(playerid);
}
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 1)
{
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "RicAdmin/users/%s.ini", name);
if(!response) return Kick(playerid);
if(!strlen(inputtext)) return
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Hi your not registered", "Welcome, your not registered mate, input your registration pw below", "Register", "Leave");
dini_Create(file);
dini_IntSet(file, "Password", udb_hash(inputtext));
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
dini_IntSet(file, "Cash",PlayerInfo[playerid][Cash] = 500);
dini_IntSet(file, "Score",PlayerInfo[playerid][Score] = 0);
dini_IntSet(file, "Job",PlayerInfo[playerid][Job] = 0);
dini_IntSet(file, "Color",PlayerInfo[playerid][Color] = 0);
dini_IntSet(file, "Vw",PlayerInfo[playerid][Vw] = 0);
dini_IntSet(file, "Int",PlayerInfo[playerid][Int] = 0);
dini_IntSet(file, "Warns",PlayerInfo[playerid][Warns] = 0);
format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s, you have been auto logged in.", name, inputtext);
SendClientMessage(playerid, 0xFF00CC, string);
IsLogged[playerid] = 1;
}

if (dialogid == 2)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "RicAdmin/users/%s.ini", name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "You are registred, please login.", "Login", "Leave");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp) {
SendClientMessage(playerid, 0xFF00CC, "Wrong PW sir.");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Hi your registered", "You are registred, put the password below.", "Login", "Leave");
}
else
{
IsLogged[playerid] = 1;
SetPlayerMoney(playerid, dini_Int(file, "Cash"));
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerColor(playerid, dini_Int(file, "Color"));
SetPlayerVirtualWorld(playerid, dini_Int(file, "Vw"));
SetPlayerInterior(playerid, dini_Int(file, "Int"));
PlayerInfo[playerid][Job] = dini_Int(file, "Job");
PlayerInfo[playerid][Warns] = dini_Int(file, "Warns");
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
SendClientMessage(playerid,0xFF00CC, "[SYSTEM]: Successfully logged in!");
}
}
return 1;
}

Thank you very much!

NewerthRoleplay
20/03/2012, 08:31 PM
Did you literally just post your whole script