02.10.2011, 23:10
errors
and my script
Код:
C:\Users\ChrissyH\Desktop\Gm.pwn(50) : error 001: expected token: ";", but found "new" C:\Users\ChrissyH\Desktop\Gm.pwn(247) : error 028: invalid subscript (not an array or too many subscripts): "Member" C:\Users\ChrissyH\Desktop\Gm.pwn(247) : warning 215: expression has no effect C:\Users\ChrissyH\Desktop\Gm.pwn(247) : error 001: expected token: ";", but found "]" C:\Users\ChrissyH\Desktop\Gm.pwn(247) : error 029: invalid expression, assumed zero C:\Users\ChrissyH\Desktop\Gm.pwn(247) : fatal error 107: too many error messages on one line
and my script
Код:
// Hey there [mG]Thomas_Mattingly comming at ya Compile run it have fun :D #include <a_samp> #include <zcmd> #include <streamer> #include <sscanf> #include <dini> #include <dudb> #pragma unused ret_memcpy #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define red 0xFF0000FF #define COLOR_YELLOW 0xFFFF00AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_BLUE 0x0000BBAA #define COLOR_LIGHTBLUE 0x33CCFFAA // - Ewww Aztecas colours #define orange 0xFF9900AA #define COLOR_RED 0xAA3333AA #define COLOR_LIME 0x10F441AA // - LIME FTW #define COLOR_MAGENTA 0xFF00FFFF #define COLOR_NAVY 0x000080AA #define COLOR_AQUA 0xF0F8FFAA #define COLOR_CRIMSON 0xDC143CAA #define COLOR_FLBLUE 0x6495EDAA #define COLOR_BISQUE 0xFFE4C4AA #define COLOR_BLACK 0x000000AA #define COLOR_CHARTREUSE 0x7FFF00AA #define COLOR_BROWN 0XA52A2AAA #define COLOR_CORAL 0xFF7F50AA #define COLOR_GOLD 0xB8860BAA #define COLOR_GREENYELLOW 0xADFF2FAA #define COLOR_INDIGO 0x4B00B0AA #define COLOR_IVORY 0xFFFF82AA #define COLOR_LAWNGREEN 0x7CFC00AA #define COLOR_SEAGREEN 0x20B2AAAA #define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime #define COLOR_MIDNIGHTBLUE 0X191970AA #define COLOR_MAROON 0x800000AA #define COLOR_OLIVE 0x808000AA #define COLOR_ORANGERED 0xFF4500AA #define COLOR_PINK 0xFFC0CBAA // - Light light pink #define COLOR_SPRINGGREEN 0x00FF7FAA #define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P #define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green #define COLOR_MEDIUMAQUA 0x83BFBFAA #define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^ new Army1,Army2,Army3,Army4,Army5,Army6,Army7 new ID,org,str[128],SaveTimer[MAX_PLAYERS],alevel,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],file[128],vlevel,IsRequesting[MAX_PLAYERS],request[MAX_PLAYERS]; new stars,Reason[128],Cuffed[MAX_PLAYERS]; enum pData { Name[MAX_PLAYER_NAME], Password[32], AdminLevel, Cash, Score, vip, Member, Leader, IsInOrg, IsLaw, IsGang, IsPriv, WantedLevel }; new FSave[500]; new Logged[MAX_PLAYERS]; new PlayerData[MAX_PLAYERS][pData]; main() { print("\n----------------------------------"); print("~Cromes Server~"); print("----------------------------------\n"); } forward Save(playerid); public Save(playerid) { if(Logged[playerid] == 1) { dini_IntSet(file, "AdminLevel",PlayerData[playerid][AdminLevel]); dini_IntSet(file, "Cash",GetPlayerMoney(playerid)); dini_IntSet(file,"Score",GetPlayerScore(playerid)); dini_IntSet(file,"Vip",PlayerData[playerid][vip]); dini_IntSet(file,"Member",PlayerData[playerid][Member]); dini_IntSet(file,"Leader",PlayerData[playerid][Leader]); dini_IntSet(file,"IsInOrg",PlayerData[playerid][IsInOrg]); dini_IntSet(file,"IsLaw",PlayerData[playerid][IsLaw]); dini_IntSet(file,"IsGang",PlayerData[playerid][IsGang]); dini_IntSet(file,"IsPriv",PlayerData[playerid][IsPriv]); dini_IntSet(file,"WantedLevel",GetPlayerWantedLevel(playerid)); } } public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Freeroam/RolePlay"); AddPlayerClass(28,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(23,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(15,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(12,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(299,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(188,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(154,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(2,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(266,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(267,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(268,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(271,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(272,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(290,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(294,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(295,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(47,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); AddPlayerClass(291,1705.6431,1452.7920,10.8170,268.1469, 0, 0, 0, 0, 0, 0); Army1 = AddStaticVehicle(470,285.5081,1938.0142,17.6343,179.8206,69,35); // army 1 Army2 = AddStaticVehicle(470,281.3004,1938.0024,17.6313,181.2387,109,69); // army 2 Army3 = AddStaticVehicle(470,277.6845,1937.9998,17.6320,180.0951,116,2); // army 3 Army4 = AddStaticVehicle(563,369.6120,1914.6438,18.3386,75.9052,106,29); // hc 1 Army5 = AddStaticVehicle(563,367.7668,1933.3474,18.3492,94.7392,76,38); // hc 2 Army6 = AddStaticVehicle(433,274.5108,1935.7186,18.0765,181.6064,97,52); // barracks1 Army7 = AddStaticVehicle(433,269.3683,1935.7397,18.0778,178.9587,30,55); // barracks2 return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid,2537.1050,-1677.2736,19.9302); SetPlayerFacingAngle(playerid,85.8876); SetPlayerCameraPos(playerid,2526.7771,-1675.5574,19.9302); SetPlayerCameraLookAt(playerid,2526.7771,-1675.5574,19.9302); return 1; } public OnPlayerConnect(playerid) { FSave[playerid] = SetTimerEx("Save",1000,true,"i",playerid);//This creates a timer when the player spawns and it saves the file ever 1 second. Logged[playerid] = 0; GetPlayerName(playerid,Nam, sizeof(Nam)); format(file, sizeof(file),"myserver/%s.ini", Nam); if (!dini_Exists(file)) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register", "Welcome to Chromes Gaming Freeroam / Roleplay, Make your password below", "Register", "Leave"); } if(fexist(file)) { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Welcome to Chromes Gaming Freeroam / Roleplay Login with your password", "Login", "Leave"); } return 1; } public OnPlayerDisconnect(playerid, reason) { GetPlayerName(playerid, pname, sizeof(pname)); switch(reason) { case 0: format(str, sizeof(str), "%s has left the server. (Lost Connection)", pname); case 1: format(str, sizeof(str), "%s has left the server. (Leaving)", pname); case 2: format(str, sizeof(str), "%s has left the server. (Kicked / Banned)",pname); } SendClientMessageToAll(0xAFAFAFAA, str); GetPlayerName(playerid,Nam, sizeof(Nam)); format(file, sizeof(file),"myserver/%s.ini",Nam); if(Logged[playerid] == 1) { dini_IntSet(file, "AdminLevel",PlayerData[playerid][AdminLevel]); dini_IntSet(file,"Cash",GetPlayerMoney(playerid)); dini_IntSet(file,"Score",GetPlayerScore(playerid)); dini_IntSet(file,"Vip",PlayerData[playerid][vip]); dini_IntSet(file,"Member",PlayerData[playerid][Member]); dini_IntSet(file,"Leader",PlayerData[playerid][Leader]); dini_IntSet(file,"IsInOrg",PlayerData[playerid][IsInOrg]); dini_IntSet(file,"IsLaw",PlayerData[playerid][IsLaw]); dini_IntSet(file,"IsGang",PlayerData[playerid][IsGang]); dini_IntSet(file,"IsPriv",PlayerData[playerid][IsPriv]); dini_IntSet(file,"WantedLevel",GetPlayerWantedLevel(playerid)); } return 1; } public OnPlayerSpawn(playerid) { if(PlayerData[playerid][Member] == 0) { SetPlayerColor(playerid,-1); } if(PlayerData[playerid][Member] == 1) { SetPlayerColor(playerid,0x1B5E23FF); GivePlayerWeapon(ID,31,5000); GivePlayerWeapon(ID,24,5000); GivePlayerWeapon(ID,29,5000); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { if(PlayerData[killerid][IsLaw] == 0) { SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+1); } return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == Army1 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandres Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == Army3 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandres Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == Army4 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandres Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == Army5 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandres Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == Army6 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandres Army!"); } } if(newstate == PLAYER_STATE_DRIVER) { new vid = GetPlayerVehicleID(playerid); if(vid == Army7 && Member[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, red, "This Belongs To The Sanandres Army!"); } return 1; } public OnPlayerEnterCheckpoint(playerid) { 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) { 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(response) { GetPlayerName(playerid,Nam,sizeof(Nam)); format(file,sizeof(file),"myserver/%s.ini",Nam); if(!response) { SendClientMessage(playerid,orange,"Ok then, if you wanna register later come to this server again!"); Kick(playerid); } if(!strlen(inputtext)) { SendClientMessage(playerid,red,"ERROR: You need to enter a password!"); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register", "Welcome to Cromes server, Make your password below", "Register", "Leave"); } dini_Create(file); { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Welcome to Crome's Server Please logon", "Login", "Leave"); dini_IntSet(file,"Password",udb_hash(inputtext)); dini_IntSet(file, "AdminLevel",PlayerData[playerid][AdminLevel] = 0); dini_IntSet(file,"Cash",PlayerData[playerid][Cash] = 0); dini_IntSet(file,"Score",PlayerData[playerid][Score] = 0); dini_IntSet(file,"Vip",PlayerData[playerid][vip] = 0); dini_IntSet(file,"Member",PlayerData[playerid][Member] = 0); dini_IntSet(file,"Leader",PlayerData[playerid][Leader] = 0); dini_IntSet(file,"IsInOrg",PlayerData[playerid][IsInOrg] = 0); dini_IntSet(file,"IsLaw",PlayerData[playerid][IsLaw] = 0); dini_IntSet(file,"IsGang",PlayerData[playerid][IsGang] = 0); dini_IntSet(file,"IsPriv",PlayerData[playerid][IsPriv] = 0); dini_IntSet(file,"WantedLevel",PlayerData[playerid][WantedLevel] = 0); } } } if(dialogid == 2) { if(response) { GetPlayerName(playerid,Nam,sizeof(Nam)); format(file,sizeof(file),"myserver/%s.ini",Nam); if(!response) { SendClientMessage(playerid,orange,"Ok then, if you don't want to login and leave that is fine for me!"); Kick(playerid); } if(!strlen(inputtext)) { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Welcome to Vercetti Gaming Freeroam / Roleplay Login with your password", "Login", "Leave"); } new tmp; tmp = dini_Int(file, "Password"); if(udb_hash(inputtext) != tmp) { SendClientMessage(playerid,red,"ERROR: You have entered the wrong password!"); ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Welcome to Vercetti Gaming Freeroam / Roleplay Login with your password", "Login", "Leave"); } else { Logged[playerid] = 1; SaveTimer[playerid] = SetTimerEx("Save",10000,true,"i",playerid); PlayerData[playerid][AdminLevel] = dini_Int(file,"AdminLevel"); GivePlayerMoney(playerid,dini_Int(file,"Cash")); SetPlayerScore(playerid,dini_Int(file,"Score")); PlayerData[playerid][vip] = dini_Int(file,"Vip"); PlayerData[playerid][Member] = dini_Int(file,"Member"); PlayerData[playerid][Leader] = dini_Int(file,"Leader"); PlayerData[playerid][IsInOrg] = dini_Int(file,"IsInOrg"); PlayerData[playerid][IsLaw] = dini_Int(file,"IsLaw"); PlayerData[playerid][IsGang] = dini_Int(file,"IsGang"); PlayerData[playerid][IsPriv] = dini_Int(file,"IsPriv"); SetPlayerWantedLevel(playerid,dini_Int(file,"WantedLevel")); SendClientMessage(playerid,orange,"You have successfully log in and restored your stats!"); if(PlayerData[playerid][Member] == 0) { SendClientMessage(playerid,orange,"Organization: None."); } if(PlayerData[playerid][Member] == 1) { SendClientMessage(playerid,orange,"Organization: San Andreas Army."); } } } } if(dialogid == 3) { if(response) { GetPlayerName(playerid,Nam,sizeof(Nam)); if(listitem == 0) { format(str,sizeof(str),"%s Is requesting to join San Andreas Army",Nam); SendClientMessageToAll(orange,str); IsRequesting[playerid] = 1; request[playerid] = 1; } } } return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } CMD:setadmin(playerid, params[]) { if(!IsPlayerAdmin(playerid))return 0; if(sscanf(params,"ui",ID,alevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setadmin [ID] [Level 1-5]"); if(alevel > 5) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE LEVELS 1-5!"); if(!IsPlayerConnected(ID))return SendClientMessage(playerid,red,"That user is not connected."); if(PlayerData[ID][AdminLevel] == alevel) return SendClientMessage(playerid,0xFF0000FF, "ERROR: That person is already this admin level!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); if(alevel == 0) { format(str, sizeof(str),"%s has your Admin level to %d on the server. *cry *cry",Nam,alevel); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s Admin level to %d!",pname,alevel); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][AdminLevel] = alevel; return 1; } format(str, sizeof(str),"%s has your Admin level to %d on the server.",Nam,alevel); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s Admin level to %d!",pname,alevel); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][AdminLevel] = alevel; return 1; } CMD:setvip(playerid, params[]) { if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command."); if(sscanf(params,"ui",ID,vlevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setvip [ID] [Level 1-3]"); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,0xFF0000FF, "That user is not connected."); if(vlevel > 3) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE VIP LEVELS 1-3!"); if(vlevel == 0) { if(PlayerData[ID][vip] == 0) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 0 vip!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); format(str, sizeof(str),"%s has set your VIP Level to 0!",Nam); SendClientMessage(ID,0xFF9900AA,str); format(str,sizeof(str),"You had set %s VIP Level to 0!",pname); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][vip] = 0; } if(vlevel == 1) { if(PlayerData[ID][vip] == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 1 vip!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); format(str, sizeof(str),"%s has set your VIP Level to 1 (BRONZE VIP)!",Nam); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s VIP Level to 1 (BRONZE VIP)!",pname); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][vip] = 1; } if(vlevel == 2) { if(PlayerData[ID][vip] == 2) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 2 vip!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); format(str, sizeof(str),"%s has set your VIP Level to 2 (SILVER VIP)!",Nam); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s VIP Level to 2 (SILVER VIP)!",pname); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][vip] = 2; } if(vlevel == 3) { if(PlayerData[ID][vip] == 3) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 3 vip!"); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); GetPlayerName(ID,pname,MAX_PLAYER_NAME); format(str, sizeof(str),"%s has set your VIP Level to 3 (GOLD VIP)!",Nam); SendClientMessage(ID,0xFF9900AA,str); format(str, sizeof(str),"You had set %s VIP Level to 3 (GOLD VIP)!",pname); SendClientMessage(playerid,0xFF9900AA,str); PlayerData[ID][vip] = 3; } return 1; } CMD:setleader(playerid,params[]) { if(!IsPlayerAdmin(playerid)) return 0; if(sscanf(params,"ui",ID,org)) return SendClientMessage(playerid,orange,"USAGE: /setleader [id] [orgid]"); GetPlayerName(playerid,Nam,sizeof(Nam)); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not connected!"); GetPlayerName(ID,pname,sizeof(pname)); if(org == 1) { format(str,sizeof(str),"Administrator %s has set you the leader of San Andreas Army, use /lawcmds for commands",Nam); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have set %s the leader of San Andreas Army",pname); SendClientMessage(playerid,orange,str); SetPlayerColor(ID,0x1B5E23FF); GivePlayerWeapon(ID,31,5000); GivePlayerWeapon(ID,24,5000); GivePlayerWeapon(ID,29,5000); PlayerData[ID][IsInOrg] = 1; PlayerData[ID][Member] = 1; PlayerData[ID][Leader] = 1; IsRequesting[ID] = 0; request[ID] = 0; PlayerData[ID][IsLaw] = 1; PlayerData[ID][IsGang] = 0; PlayerData[ID][IsPriv] = 0; } return 1; } CMD:kickmember(playerid,params[]) { if(PlayerData[playerid][Leader] != 1) return 0; if(sscanf(params,"us",ID,Reason)) return SendClientMessage(playerid,orange,"USAGE: /kickmember [id] [Reason]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(PlayerData[ID][Member] == 1 && PlayerData[playerid][Leader] == 1) { format(str,sizeof(str),"%s has kicked you out of the organization for: %s!",Nam,Reason); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have kicked %s out your organization for: %s!",pname,Reason); SendClientMessage(playerid,orange,str); SetPlayerColor(ID,-1); ResetPlayerWeapons(ID); PlayerData[ID][Leader] = 0; PlayerData[ID][Member] = 0; PlayerData[ID][IsInOrg] = 0; IsRequesting[ID] = 0; request[ID] = 0; PlayerData[ID][IsLaw] = 0; PlayerData[ID][IsGang] = 0; PlayerData[ID][IsPriv] = 0; } return 1; } CMD:request(playerid,params[]) { if(IsRequesting[playerid] == 1) return SendClientMessage(playerid,red,"ERROR: You are already requesting for a organization, /cancelrequest"); if(PlayerData[playerid][IsInOrg] == 1) return SendClientMessage(playerid,red,"ERROR: You are in a organization!"); ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Gang Request","San Andreas Army","Join","Close"); return 1; } CMD:cancelrequest(playerid, params[]) { if(request[playerid] == 0) return SendClientMessage(playerid,red,"ERROR: You are not requesting to join a organization!"); GetPlayerName(playerid,Nam,sizeof(Nam)); if(request[playerid] == 1) { format(str,sizeof(str),"%s has canceled his/her request to join San Andreas Army",Nam); SendClientMessageToAll(orange,str); IsRequesting[playerid] = 0; request[playerid] = 0; } return 1; } CMD:decline(playerid,params[]) { if(PlayerData[playerid][Leader] != 1) return 0; if(sscanf(params,"u",ID)) return SendClientMessage(playerid,orange,"USAGE: /decline [id]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(PlayerData[playerid][Leader] == 1 && request[ID] == 1) { format(str,sizeof(str),"%s has declined %s Request for San Andreas Army!",Nam,pname); SendClientMessageToAll(orange,str); IsRequesting[ID] = 0; request[ID] = 0; } return 1; } CMD:accept(playerid,params[]) { if(PlayerData[playerid][Leader] != 1) return 0; if(sscanf(params,"u",ID)) return SendClientMessage(playerid,orange,"USAGE: /accept [id]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(PlayerData[playerid][Leader] == 1 && request[ID] == 1) { format(str,sizeof(str),"%s has accepted your request for San Andreas Army, use /lawcmds for commands",Nam); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have accepted %s into San Andreas Army",pname); SendClientMessage(playerid,orange,str); SetPlayerColor(ID,0x1B5E23FF); GivePlayerWeapon(ID,31,5000); GivePlayerWeapon(ID,24,5000); GivePlayerWeapon(ID,29,5000); PlayerData[ID][IsInOrg] = 1; PlayerData[ID][Member] = 1; PlayerData[ID][Leader] = 0; IsRequesting[ID] = 0; request[ID] = 0; PlayerData[ID][IsLaw] = 1; PlayerData[ID][IsGang] = 0; PlayerData[ID][IsPriv] = 0; } return 1; } CMD:leadercmds(playerid,params[]) { if(PlayerData[playerid][Leader] == 1) { SendClientMessage(playerid,-1,"LEADER CMDS:/kickmember /accept /decline"); } else return 0; return 1; } CMD:pu(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { SendClientMessageToAll(COLOR_BLUE,"This is the Police, Pull over right now or we will use force"); } else return 0; return 1; } CMD:lawcmds(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { SendClientMessage(playerid,-1,"LAWCMDS: /pu /want /cuff /uncuff /lc /wanted"); } else return 0; return 1; } CMD:gangcmds(playerid,params[]) { if(PlayerData[playerid][IsGang] == 1) { SendClientMessage(playerid,-1,"GANGCMDS: /gc"); } else return 0; return 1; } CMD:privcmds(playerid,params[]) { if(PlayerData[playerid][IsPriv] == 1) { SendClientMessage(playerid,-1,"PRIVCMDS: /pc"); } else return 0; return 1; } CMD:want(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { if(sscanf(params,"ui",ID,stars)) return SendClientMessage(playerid,orange,"USAGE: /want [ID][stars]"); if(stars > 6) return SendClientMessage(playerid,red,"ERROR: You cannot want over 6 stars!"); if(stars < 0) return SendClientMessage(playerid,red,"ERROR: You cannot want under 0 stars!"); if(PlayerData[ID][IsLaw] == 1) return SendClientMessage(playerid,red,"ERROR: You cannot want other law officer!"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); format(str,sizeof(str),"Officer %s has set %s wanted level to %d",Nam,pname,stars); SendClientMessageToAll(orange,str); SetPlayerWantedLevel(ID,stars); } else return 0; return 1; } CMD:cuff(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { if(sscanf(params,"u",ID)) return SendClientMessage(playerid,orange,"USAGE: /cuff [id]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(Cuffed[ID] == 1) return SendClientMessage(playerid,red,"ERROR: That user is already cuffed!"); if(PlayerData[ID][IsLaw] == 1) return SendClientMessage(playerid,red,"ERROR: You cannot cuff another law!"); if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"ERROR: You cannot cuff people in vehicle!"); if(GetDistanceBetweenPlayers(playerid,ID) > 2) return SendClientMessage(playerid,red,"ERROR: That user is not near you!"); LoopingAnim(ID, "ped", "cower", 3.0, 1, 0, 0, 0, 0); format(str,sizeof(str),"You have been handcuffed by Officer %s",Nam); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have handcuffed %s",pname); Cuffed[ID] = 1; SendClientMessage(playerid,orange,str); TogglePlayerControllable(ID,0); } else return 0; return 1; } CMD:uncuff(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { if(sscanf(params,"u",ID)) return SendClientMessage(playerid,orange,"USAGE: /uncuff [id]"); GetPlayerName(playerid,Nam,sizeof(Nam)); GetPlayerName(ID,pname,sizeof(pname)); if(Cuffed[ID] == 0) return SendClientMessage(playerid,red,"ERROR: That user is not handcuffed!"); if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid,red,"ERROR: That user is not connected!"); if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"ERROR: You cannot uncuff people in vehicle!"); if(GetDistanceBetweenPlayers(playerid,ID) > 2) return SendClientMessage(playerid,red,"ERROR: That user is not near you!"); format(str,sizeof(str),"You have been uncuffed by Officer %s",Nam); SendClientMessage(ID,orange,str); format(str,sizeof(str),"You have uncuffed %s",pname); SendClientMessage(playerid,orange,str); Cuffed[ID] = 0; TogglePlayerControllable(ID,1); } else return 0; return 1; } CMD:lc(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { if(isnull(params)) return SendClientMessage(playerid,orange,"USAGE: /lc [message]"); GetPlayerName(playerid,Nam,sizeof(Nam)); format(str,sizeof(str),"[LAWCHAT] %s: %s",Nam,params); for(new i = 0; i < MAX_PLAYERS; ++i) { if(IsPlayerConnected(i) && !IsPlayerNPC(i)) { if(PlayerData[i][IsLaw] == 1) { SendClientMessage(i,COLOR_BLUE,str); } } } } else return 0; return 1; } CMD:gc(playerid,params[]) { if(PlayerData[playerid][IsGang] == 1) { if(isnull(params)) return SendClientMessage(playerid,orange,"USAGE: /gc [message]"); GetPlayerName(playerid,Nam,sizeof(Nam)); format(str,sizeof(str),"[GANGCHAT] %s: %s",Nam,params); for(new i = 0; i < MAX_PLAYERS; ++i) { if(!IsPlayerConnected(i) && !IsPlayerNPC(i)) { if(PlayerData[i][IsGang] == 1) { SendClientMessage(i,red,str); } } } } else return 0; return 1; } CMD:orgs(playerid,params[]) { SendClientMessage(playerid,orange,"San Andreas Army || Leader: Cromehd"); return 1; } CMD:pc(playerid,params[]) { if(PlayerData[playerid][IsPriv] == 1) { if(isnull(params)) return SendClientMessage(playerid,orange,"USAGE: /pc [message]"); GetPlayerName(playerid,Nam,sizeof(Nam)); format(str,sizeof(str),"[PRIVCHAT] %s: %s",Nam,params); for(new i = 0; i < MAX_PLAYERS; ++i) { if(!IsPlayerConnected(i) && !IsPlayerNPC(i)) { if(PlayerData[i][IsPriv] == 1) { SendClientMessage(i,COLOR_GREY,str); } } } } else return 0; return 1; } CMD:wanted(playerid,params[]) { if(PlayerData[playerid][IsLaw] == 1) { SendClientMessage(playerid,orange,"Wanted List"); for(new i; i < MAX_PLAYERS; i++) { GetPlayerName(i,Nam, sizeof(Nam)); if(GetPlayerWantedLevel(i) >= 1) { format(str, sizeof str, "%s - Wanted Level: %d",Nam, GetPlayerWantedLevel(i)); SendClientMessage(playerid,orange, str); } } } else return 0; return 1; } stock GetDistanceBetweenPlayers(playerid,playerid2) { new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2; new Float:tmpdis; GetPlayerPos(playerid,x1,y1,z1); GetPlayerPos(playerid2,x2,y2,z2); tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2)); return floatround(tmpdis); } new gPlayerUsingLoopingAnim[MAX_PLAYERS]; new animation[200]; LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp) { gPlayerUsingLoopingAnim[playerid] = 1; ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp); animation[playerid]++; }