03.07.2012, 15:30
Hello, i have my script but its in r6 functions of blueg's mysql plugin i dunno how to convert it to r7 can someone help me?
pawn Код:
// i take hardly any credits for the include as i made only 50% of it
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*\
|| ||
|| Started Creating on the 22nd June 2012 By Brennan Butler (brennan9723@hotmail.com). ||
|| This is a script for SFCNR(San Fierro Cops And Robbers) ||
|| This game mode is using mysql for better saving and a custom ucp ||
|| ||
|| ||
\*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
//==============================[INCLUDES]======================================//
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <a_mysql>
#include <streamer>
#include <foreach>
#include <sfcnr>
#include <SpecVeh>
//============================[OTHER]=========================================//
forward SetPlayerRandomSpawn(playerid);
new bool:Spawned[MAX_PLAYERS];
/*native SendClientMessageToAdmins(const str[]);
native Announce(const str[]);
native SendRadioMessageToCops(const str[]);
native SendRadioMessageToMedics(const str[]);
native SendRadioMessageToHitmen(const str[]);
native GivePlayerScore(playerid, score);
native GivePlayerWantedLevel(playerid, level);
native IsPlayerSpawned(playerid);
native GetPlayerBankCash(playerid);
native SetPlayerBankCash(playerid, cash);
native GetPlayerAdminLevel(playerid);
native SetPlayerAdminLevel(playerid, level);
native GetPlayerRobbingSkill(playerid);
native SetPlayerRobbingSkill(playerid, skill);
native GetPlayerTerrorSkill(playerid);
native SetPlayerTerrorSkill(playerid, skill);
native GetPlayerWarnings(playerid);
native SetPlayerWarnings(playerid, warns);
native SetPlayerJailed(playerid, bool);
native GetPlayerC4Amount(playerid);
native SetPlayerC4Amount(playerid, amount);
native GetPlayerDrugs(playerid);
native SetPlayerDrugs(playerid, amount);
native IsPlayerJailed(playerid);
native IsPlayerBarOwner(playerid);
forward SetupPlayerForClassSelection(playerid);
forward PayDay(playerid);
forward ForumP();
forward ScoreTimer(playerid);
forward Wank(playerid);
forward IsNumeric(const string[]);
forward SetPlayerRandomSpawn(playerid);
forward CluckinJob(playerid);
forward WellSTimer(playerid);
forward BurgerTimer(playerid);
forward Unfreeze(playerid);
forward OnPlayerTazePlayer(playerid);
forward CheckStatus();
forward AntiTK();
forward TimeUpdate();
forward WantedLevel();
forward Float:GetDistanceBetweenPlayers(p1, p2);
forward ShowCarListMenu(playerid);
forward Unjail();
forward ResetParamedicWeapons();
forward DriverSalary();
forward SafeSetPlayerPos(playerid, Float:x, Float:y, Float:z);*/
//============================[DEFINES]==========================================//
#define IsPlayerSpawned(%1) Spawned[%1]
#define DIALOG_REG 1
#define DIALOG_LOG 2
#define DIALOG_ADMIN 3
#define DIALOG_BANK 4
#define DIALOG_CRIMES 5
#define COLOR_ORANGE 0xFF8000FF
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BLUE1 0x0066FFFF
#define COLOR_RED 0xAA3333AA
#define COLOR_RED2 0xFF0000FF
#define COLOR_REALRED 0xFF0606FF
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_VIP 0xC93CCE00
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_BLACK 0x000000AA
#define COLOR_MAROON #800000
//================================[MYSQL]===============================================//
#define mysql_host "localhost"
#define mysql_user "root"
#define mysql_password ""
#define mysql_database "sfcnr"
//============================[CLASS DEFINES]==========================================//
#define STAT 1
#define SWAT 2
#define ARMY 3
#define POLICE 4
#define RAPIST 5
#define MECHANIC 6
#define PARAMEDIC 7
#define HITMAN 8
#define DRUG 9
#define ROB 10
#define WEP 11
#define ITEMS 12
#define KIDNAPPER 13
#define PEDO 14
#define TRUCKER 15
#define TAXI 16
#define TEROIST 17
#define CIVILIAN 18
#define COLOR_STAT COLOR_ORANGE
#define COLOR_SWAT COLOR_LIGHTBLUE
#define COLOR_ARMY COLOR_TAN
#define COLOR_POLICE COLOR_BLUE
#define COLOR_CIVILIAN COLOR_WHITE
#define COLOR_MECHANIC COLOR_GREY
#define COLOR_PARAMEDIC COLOR_INDIGO
#define COLOR_HITMAN COLOR_WHITE
new gTeam[MAX_PLAYERS];
new Weed[MAX_PLAYERS];
new Water[MAX_PLAYERS];
new pWeed[MAX_PLAYERS];
new PlantedWeed[MAX_PLAYERS];
new wBusy[MAX_PLAYERS];
new cuffed[MAX_PLAYERS];
new Tazed[MAX_PLAYERS];
new DrugTimer[MAX_PLAYERS];
new Gateopen[MAX_PLAYERS];
main()
{
print("\n||====================================================||");
print("|| Sfcnr Include made by brennan butler(not all) ||");
print("|| only for the use of sfcnr made by Brennan &||");
print("|| Josip ||");
print("||====================================================||\n");
print("\n*********************************");
print(" San Fierro Cops And Robbers");
print(" Owned by thefatshizms and Joseph");
print(" devolped by thefatshizms");
print("**********************************\n");
}
enum PInfo
{
Pusername[25],
Ppassword[24],
Pscore,
Pmoney,
Pbank,
Pstat,
Parmy,
Pswat,
Padmin,
Pcop,
Pregdate,
Preg,
Plog,
Preport,
Pwarned,
Pprison,
Phelper,
Pemail[255],
Pvip,
Ptime,
Parrest,
Psurender,
Prob,
Prape,
Pheal,
Phitmanlvl,
Psales,
Pwepd,
Pgmem,
Pgown,
Ptruck,
}
new PlayerInfo[MAX_PLAYERS][PInfo];
new Swatgopen, Swatgclosed;
public OnGameModeInit()
{
CreateVehicle(411,-2270.60009766,2288.60009766,4.59999990,270.00000000,-1,6,15); //Infernus
CreateVehicle(411,-2270.60009766,2285.69995117,4.59999990,270.00000000,-1,6,15); //Infernus
CreateVehicle(411,-2270.39990234,2291.50000000,4.59999990,270.00000000,-1,6,15); //Infernus
CreateVehicle(560,-2270.00000000,2294.39990234,4.59999990,270.00000000,-1,-1,15); //Sultan
CreateVehicle(560,-2269.89990234,2297.19995117,4.59999990,270.00000000,25,1,15); //Sultan
CreateVehicle(560,-2270.30004883,2300.19995117,4.59999990,270.00000000,25,1,15); //Sultan
CreateVehicle(528,-2270.80004883,2303.60009766,4.80000019,268.00000000,-1,-1,15); //FBI Truck
CreateVehicle(528,-2270.50000000,2306.50000000,5.00000000,267.99499512,-1,-1,15); //FBI Truck
CreateVehicle(528,-2270.80004883,2309.50000000,5.00000000,267.99499512,-1,-1,15); //FBI Truck
CreateVehicle(490,-2271.00000000,2312.30004883,5.09999990,270.00000000,-1,6,15); //FBI Rancher
CreateVehicle(490,-2271.00000000,2315.39990234,5.09999990,270.00000000,-1,6,15); //FBI Rancher
CreateVehicle(490,-2271.10009766,2318.30004883,5.09999990,270.00000000,-1,6,15); //FBI Rancher
CreateVehicle(432,-2271.10009766,2324.89990234,4.90000010,268.00000000,-1,-1,15); //Rhino
CreateVehicle(432,-2233.50000000,2307.10009766,5.40000010,89.99499512,-1,-1,15); //Rhino
CreateVehicle(432,-2293.19995117,2232.89990234,5.09999990,1.99450684,-1,-1,15); //Rhino
CreateVehicle(469,-2223.69995117,2328.30004883,7.59999990,0.00000000,-1,-1,15); //Sparrow
CreateVehicle(469,-2233.60009766,2327.10009766,7.59999990,0.00000000,-1,-1,15); //Sparrow
Swatgclosed = CreateObject(987,-2269.39990234,2357.00000000,4.00000000,0.00000000,0.00000000,236.00000000); //object(elecfence_bar) (1)
CreateObject(987,-2269.10009766,2357.00000000,4.00000000,0.00000000,0.00000000,57.99731445); //object(elecfence_bar) (2)
CreateObject(987,-2262.69995117,2367.10009766,4.19999981,0.00000000,0.00000000,57.99682617); //object(elecfence_bar) (3)
CreateObject(987,-2281.39990234,2336.69995117,4.00000000,0.00000000,0.00000000,63.99682617); //object(elecfence_bar) (4)
CreateObject(987,-2299.89990234,2337.10009766,4.00000000,0.00000000,0.00000000,177.99536133); //object(elecfence_bar) (5)
CreateObject(987,-2186.60009766,2424.50000000,0.20000000,0.00000000,0.00000000,133.99499512); //object(elecfence_bar) (6)
CreateObject(987,-2219.60009766,2457.80004883,0.00000000,0.00000000,0.00000000,133.99475098); //object(elecfence_bar) (7)
UsePlayerPedAnims();
SetGameModeText("Cops And Robbers");
AddPlayerClass(165,-2237.7124,2353.5083,4.9804,134.5635,0,0,0,0,0,0);// stat spawn
AddPlayerClass(166,-2237.7124,2353.5083,4.9804,134.5635,0,0,0,0,0,0);// stat spawn
AddPlayerClass(287,-1345.5194,500.1661,18.2344,10.9961,0,0,0,0,0,0);// army spawn
AddPlayerClass(179,-1345.5194,500.1661,18.2344,10.9961,0,0,0,0,0,0);// army spawn
AddPlayerClass(285,-993.0158,-700.1477,32.0078,5.8923,0,0,0,0,0,0);// swat
AddPlayerClass(265,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(266,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(267,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(280,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(281,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(282,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(283,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(284,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(288,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(0,-1397.8112,-313.0121,14.1484,124.1484,0,0,0,0,0,0);//driver
AddPlayerClass(0,-2079.6611,-482.9718,38.7344,180.8663,0,0,0,0,0,0);// civilian 1
AddPlayerClass(0,-2718.9888,-318.4344,7.8438,55.5373,0,0,0,0,0,0);// civilian 2
AddPlayerClass(0,-2765.9897,375.4386,6.3347,278.5965,0,0,0,0,0,0);// civilian 3
AddPlayerClass(0,-2767.3179,788.7258,52.7813,262.3263,0,0,0,0,0,0);// civilian 4
AddPlayerClass(0,-2442.7800,752.9677,35.1719,179.2369,0,0,0,0,0,0); // civilian 5
AddPlayerClass(0,-2359.2136,1006.7867,50.6953,87.5064,0,0,0,0,0,0);// civilian 6
AddPlayerClass(0,-1725.3872,1356.5693,7.1799,107.8884,0,0,0,0,0,0);// civilian 7
AddPlayerClass(0,-1985.3896,665.8715,46.5683,275.6404,0,0,0,0,0,0);// civilian 8
AddPlayerClass(0,-2383.1177,-584.4406,132.1172,90.4442,0,0,0,0,0,0);// civilian 9
AddPlayerClass(0,-1989.2987,1118.1178,54.4688,272.2214,0,0,0,0,0,0);// civilian 10
AddPlayerClass(0,-2651.2454,609.7889,14.4531,191.8591,0,0,0,0,0,0);// medic
AddPlayerClass(0,-2126.3201,239.8671,37.3500,292.8224,0,0,0,0,0,0);// terosist
AddPlayerClass(0,-2030.6611,156.5619,28.8359,272.7437,0,0,0,0,0,0);// mechanic
AddPlayerClass(0,-1712.3699,7.4375,3.5547,316.8104,0,0,0,0,0,0);// hitman
mysql_connect(mysql_host,mysql_user,mysql_database,mysql_password);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1220.0737,-6.3703,1001.3281);
SetPlayerInterior(playerid,2);
SetPlayerFacingAngle(playerid,92.3402);
SetPlayerCameraPos(playerid,1214.3527,-6.4071,1001.3290);
SetPlayerCameraLookAt(playerid, 1220.0737,-6.3703,1000.3281);
switch(classid)
{
case 0..1:
{
GameTextForPlayer(playerid, "~y~~h~STAT", 5000, 6);
gTeam[playerid] = STAT;
}
case 2..3:
{
GameTextForPlayer(playerid, "~b~~h~ARMY", 5000, 6);
gTeam[playerid] = ARMY;
}
case 4:
{
GameTextForPlayer(playerid, "SWAT", 5000, 6);
gTeam[playerid] = SWAT;
}
case 5..13:
{
GameTextForPlayer(playerid, "~b~POLICE", 5000, 6);
gTeam[playerid] = POLICE;
}
case 14:
{
GameTextForPlayer(playerid, "~b~DRIVER", 5000, 6);
gTeam[playerid] = TAXI;
}
case 15..24:
{
GameTextForPlayer(playerid, "~w~CIVILIAN", 5000, 6);
gTeam[playerid] = CIVILIAN;
}
case 25:
{
GameTextForPlayer(playerid, "~b~MEDIC", 5000, 6);
gTeam[playerid] = PARAMEDIC;
}
case 26:
{
GameTextForPlayer(playerid, "~r~TEROIST", 5000, 6);
gTeam[playerid] = TEROIST;
}
case 27:
{
GameTextForPlayer(playerid, "~g~MECHANIC", 5000, 6);
gTeam[playerid] = MECHANIC;
}
case 28:
{
GameTextForPlayer(playerid, "~b~HITMAN", 5000, 6);
gTeam[playerid] = HITMAN;
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
Weed[playerid] =0;
Water[playerid] =0;
pWeed[playerid] =0;
PlantedWeed[playerid] =0;
wBusy[playerid] =0;
new connect[128];
format(connect, sizeof(connect), "%s Has joined San Fierro Cops And Robbers!", PlayerName(playerid));
SendClientMessageToAll(COLOR_GREY, connect);
cuffed[playerid] =0;
Spawned[playerid] =false;
Tazed[playerid] =0;
new Query[80],string[164];
GetPlayerName(playerid,PlayerName(playerid),24);
format(Query,sizeof(Query),"SELECT `Username` FROM `Users` WHERE `Username` = '%s' LIMIT 1;",PlayerName(playerid));
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0)//if number of rows is different from 0 then continue
{
format(string,sizeof(string),"Hey, %s! \nYour account is registered.\nPlease enter the password to log in!",PlayerName(playerid));
ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"Log in",string,"Login","");
}
else
{
format(string,sizeof(string),"Hey, %s! \nYour account is not registered. \nPlease register to continue!",PlayerName(playerid));
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register",string,"Register","");
}
mysql_free_result();
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new string[64], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s[%d] left the server. (Timeout/Crash)",name);
case 1: format(string,sizeof string,"%s[%d] left the server. (Leaving)",name);
case 2: format(string,sizeof string,"%s[%d] left the server. (Kicked/Banned)",name);
}
SendClientMessageToAll(COLOR_GREY,string);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
Spawned[playerid] = false;
new string[128];
format(string, sizeof(string), "You have been killed by %s for reason: %s", PlayerName(killerid), reason);
SendClientMessage(playerid, -1, string);
SendDeathMessage(killerid, playerid, reason);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid, 1);
SetPlayerInterior(playerid, 0);
if(gTeam[playerid] == STAT)
{
SendClientMessage(playerid, -1, "Welcome to stat");
SendClientMessage(playerid, -1, "You can do /class to see help for your class/team");
return 1;
}
else if(gTeam[playerid] == SWAT)
{
SendClientMessage(playerid, -1, "Welcome to swat");
SendClientMessage(playerid, -1, "You can do /class to see help for your class/team");
SetPlayerColor(playerid, COLOR_LIGHTBLUE);
return 1;
}
return 1;
}
/*public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
*/
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, -1, "You have entered a vehicle use /vm for the vehicle menu");
}
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success) {
printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
new pip[16];
foreach(Player,i) {
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true)) {
SendClientMessage(i, 0xFFFFFFFF, "Wrong Password.");
Ban(i);
}
}
}
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(strlen(inputtext) == 0)
{
ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_INPUT,"Register - Enter your password.","You're about to register a new account! \nPlease choose the password {33CCFF}for it!","Register!","Cancel!");
}
else
{
new EscapedText[60], Query[80];
mysql_real_escape_string(inputtext, EscapedText);
format(Query,sizeof(Query),"INSERT INTO `Users` (Username,Password,Money) VALUES ('%s','%s,'0')",PlayerName(playerid),EscapedText);
mysql_query(Query);
SendClientMessage(playerid,-1,"You have been successfully registered!");
GivePlayerMoney(playerid,5000);
SetPlayerScore(playerid,100);
}
}
if(dialogid == 0)
{
if(strlen(inputtext) == 0)
{
ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_INPUT,"Register - Enter your password","You are about to register a new account! \nPlease choose the password for it! \n","Register!","");
}
else
{
LoginPlayer(playerid,inputtext);
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
//======================================[GEANRUALCOMMANDS]==================================//
CMD:me(playerid, params[])
{
new msg[100];
if(sscanf(params,"s[100]",msg)) return SendClientMessage(playerid, -1, "USAGE: /me <messaage>");
if(GetPlayerMoney(playerid) < 30) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
GivePlayerMoney(playerid, -30);
format(msg, sizeof(msg), "** %s: %s", PlayerName(playerid), msg);
SendClientMessageToAll(COLOR_PURPLE, msg);
return 1;
}
CMD:pm(playerid, params[]) {
new ID, string[128], msg[56], string2[128];
if(sscanf(params,"us[56]",ID,msg)) return SendClientMessage(playerid,0xA70000FF,"Syntax: /PM [ID] [Message].");
format(string,sizeof(string),"** PM to %s: {A70000}%s",PlayerName(ID),msg);
SendClientMessage(playerid,0xFFFFFFFF,string);
format(string2,sizeof(string2),"** PM from %s: {A70000}%s",PlayerName(playerid),msg);
SendClientMessage(ID, 0xFFFFFFFF, string2);
GameTextForPlayer(playerid, "~r~PM ~b~sent!", 3000, 1);
GameTextForPlayer(ID, "~r~PM ~b~recived!", 3000, 1);
return true;
}
CMD:crime(playerid, params[])
{
#pragma unused params
SendClientMessage(playerid, -1, "Crimes - What you can get wanted for!");
ShowPlayerDialog(playerid, DIALOG_CRIMES, DIALOG_STYLE_MSGBOX, "Crimes!", "Using weed\nPlanting weed\nSelling weed\nRobing\nRaping\nMurder\nCar jacking(police)\nNot paying your fines\nNot paying tax", "ok", "close");
return 1;
}
CMD:w(playerid, params[])
{
new message[50];
if(sscanf(params,"s[50]",message)) return SendClientMessage(playerid, -1, "USAGE: /w <message>");
format(message, sizeof(message), "%s: {A70000}%s", PlayerName(playerid), message);
ProxDetector(10, playerid, message, COLOR_YELLOW);
SetPlayerChatBubble(playerid, message, COLOR_YELLOW, 10, 4000);
return 1;
}
//=======================[SPECIAL CLASS COMMADNS]===============================//
CMD:open(playerid, params[])
{
#pragma unused params
if(gTeam[playerid] == STAT)
{
MoveObject(Swatgclosed, -2269.39990234,2357.00000000,4.00000000, 2);
SendClientMessage(playerid, -1, "Stat gate open!");
Gateopen = true;
}
return 1;
}
//====================================[ANIM COMMANDS]===================================//
CMD:dance(playerid, params[])
{
new dance;
if(sscanf(params, "d", dance))
return SendClientMessage(playerid, -1, "* USE: /dance [1-4]");
if(dance == 1) { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1); }
else if(dance == 2) { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2); }
else if(dance == 3) { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3); }
else if(dance == 4) { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4); }
else { SendClientMessage(playerid, -1, "* USE: /dance [1-4]"); return 1; }
return 1;
}
CMD:smokeweed(playerid, params[])
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
return 1;
}
CMD:handsup(playerid, params[])
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
return 1;
}
//==================================[ADMIN SYSTEM]===================================//
CMD:class(playerid, params[])
{
new id, string[128], string2[128];
if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /class <id>");
format(string, sizeof(string), "You have forced %s to go to class selection", PlayerName(id));
format(string2, sizeof(string2), "You have been forced to class selection by %s", PlayerName(playerid));
SendClientMessage(playerid, -1, string);
SendClientMessage(id, -1, string2);
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
return 1;
}
CMD:getall(playerid, params[])
{
#pragma unused params
allhere(playerid);
return 1;
}
CMD:dveh(playerid, params[])
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
return 1;
}
//================================[COMMANDS FOR TESTING]==========================//
CMD:cash(playerid, params[])
{
new ammount, id;
if(sscanf(params,"ui",id,ammount)) return SendClientMessage(playerid, -1, "USAGE: /cash <id> <ammount>");
GivePlayerMoney(id, ammount);
return 1;
}
stock LoginPlayer(playerid,const password[])
{
new EscapedText[60];
new Query[80];
mysql_real_escape_string(password, EscapedText);
format(Query,sizeof(Query),"SELECT * FROM `Users` WHERE `Username` = '%s' AND `Password` = '%s'",PlayerName(playerid),EscapedText);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
SendClientMessage(playerid,-1,"You have been logged in!");
LoadStats(playerid);
}
else
{
SendClientMessage(playerid,-1,"Wrong password!");
Kick(playerid);
}
mysql_free_result();
return 1;
}
stock LoadStats(playerid)
{
new pName[24],Query[80];
GetPlayerName(playerid,pName,24);
format(Query, sizeof(Query), "SELECT * FROM `Users` WHERE `Username` = '%s' ", pName);
mysql_query(Query);
mysql_store_result();
mysql_fetch_row_format(Query, "|");
sscanf(Query, "e<p<|>s[24]s[23]i>", PlayerInfo[playerid][Pusername]);
mysql_free_result();
GivePlayerMoney(playerid,PlayerInfo[playerid][Pmoney]);
return 1;
}