08.07.2012, 11:46
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
//put this at the beginning of your game mode.
#include <a_samp>
#include <dini>
#include <dudb>
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=STRTOK=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=ISNUMERIC=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
stock IsNumeric(str[])
{
new
ch,
i;
while ((ch = str[i++])) if (ch < '0' || ch > '9') return 0;
return 1;
}
#define MAX_ORGS 13 //You can add more if you want.
enum playerinfo {
Member, //Will tell the server which org you are in..
Leader,
};
new PlayerInfo[MAX_PLAYERS][playerinfo];
new request[MAX_PLAYERS];
#define COLOR_ORED 0xFF0000FF
#define COLOR_MAIN 0x43C6DBFF
#define COLOR_GREEN 0x00FF00FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_POWDERBLUE 0xB0E0E6FF
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_GOLD 0xFFD700FF
#define COLOR_LIGHTGREEN 0x90EE90FF
enum orginfo {
Color, //Player color name
VColor, //Vehicle Color
Car1, //Vehicles
Car2, //Vehicles
Car3, //Vehicles..
Car4,
Car5,
Car6,
Car7,
Car8,
V8, //Max 8 vehicles
Skin1, //orgskin
Skin2, //orgskin
Lskin, //Leaderskin
Genre, //Law , Public Services or Gang.
};
new OrgInfo[MAX_ORGS][orginfo];
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
for(new i = 0;i<MAX_ORGS;i++)
{
new tformi[10];
format(tformi,sizeof tformi,"org%d.ini",i);
if(fexist(tformi))
{
printf("-----------------------------");
printf("Loading Organization ID %d Configuration...",i);
OrgInfo[i][Car1] = CreateVehicle(dini_Int(tformi,"Model1"),dini_Float(tformi,"X1"),dini_Float(tformi,"Y1"),dini_Float(tformi,"Z1"),dini_Float(tformi,"A1"),dini_Int(tformi,"Col1"),dini_Int(tformi,"Col2"),-1);
OrgInfo[i][Car2] = CreateVehicle(dini_Int(tformi,"Model2"),dini_Float(tformi,"X2"),dini_Float(tformi,"Y2"),dini_Float(tformi,"Z2"),dini_Float(tformi,"A2"),dini_Int(tformi,"Col1"),dini_Int(tformi,"Col2"),-1);
OrgInfo[i][Car3] = CreateVehicle(dini_Int(tformi,"Model3"),dini_Float(tformi,"X3"),dini_Float(tformi,"Y3"),dini_Float(tformi,"Z3"),dini_Float(tformi,"A3"),dini_Int(tformi,"Col1"),dini_Int(tformi,"Col2"),-1);
OrgInfo[i][Car4] = CreateVehicle(dini_Int(tformi,"Model4"),dini_Float(tformi,"X4"),dini_Float(tformi,"Y4"),dini_Float(tformi,"Z4"),dini_Float(tformi,"A4"),dini_Int(tformi,"Col1"),dini_Int(tformi,"Col2"),-1);
OrgInfo[i][Car5] = CreateVehicle(dini_Int(tformi,"Model5"),dini_Float(tformi,"X5"),dini_Float(tformi,"Y5"),dini_Float(tformi,"Z5"),dini_Float(tformi,"A5"),dini_Int(tformi,"Col1"),dini_Int(tformi,"Col2"),-1);
OrgInfo[i][Car6] = CreateVehicle(dini_Int(tformi,"Model6"),dini_Float(tformi,"X6"),dini_Float(tformi,"Y6"),dini_Float(tformi,"Z6"),dini_Float(tformi,"A6"),dini_Int(tformi,"Col1"),dini_Int(tformi,"Col2"),-1);
OrgInfo[i][Car7] = CreateVehicle(dini_Int(tformi,"Model7"),dini_Float(tformi,"X7"),dini_Float(tformi,"Y7"),dini_Float(tformi,"Z7"),dini_Float(tformi,"A7"),dini_Int(tformi,"Col1"),dini_Int(tformi,"Col2"),-1);
OrgInfo[i][Car8] = CreateVehicle(dini_Int(tformi,"Model8"),dini_Float(tformi,"X8"),dini_Float(tformi,"Y8"),dini_Float(tformi,"Z8"),dini_Float(tformi,"A8"),dini_Int(tformi,"Col1"),dini_Int(tformi,"Col2"),-1);
OrgInfo[i][Genre] = dini_Int(tformi,"Genre");
printf("Organization Cars Loaded.");
printf("Basic Organization Configuration Loaded.");
printf("Loaded Organization, %s",dini_Get(tformi,"Name"));
printf("-----------------------------");
printf("");
}
}
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][Member] = -255;
PlayerInfo[playerid][Leader] = 0;
request[playerid] = -255;
new name[MAX_PLAYER_NAME];
new file[25];
format(file, sizeof(file), "%s.ini",GetPlayerName(playerid,name,sizeof(name)));
PlayerInfo[playerid][Member] = dini_Int(file,"Member"); //Get saved file
PlayerInfo[playerid][Leader] = dini_Int(file,"Leader"); //Get saved file
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME];
new file[25];
format(file, sizeof(file), "%s.ini",GetPlayerName(playerid,name,sizeof(name)));
if(!fexist(file))
{
dini_Create(file);
}
dini_IntSet(file,"Member",PlayerInfo[playerid][Member]);
dini_IntSet(file,"Leader",PlayerInfo[playerid][Member]);
PlayerInfo[playerid][Member] = -255;
PlayerInfo[playerid][Leader] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
new filo[55];
format(filo,55,"org%d.ini",PlayerInfo[playerid][Member]);
SetPlayerColor(playerid,HexToInt(dini_Get(filo,"Color")));
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
if(strcmp(cmdtext,"/createorg",true) == 0)
{
new tmp[256],tmp2[256];
tmp = strtok(cmdtext,idx);
tmp2 = strtok(cmdtext,idx);
new orgid = strval(tmp);
new orggenre = strval(tmp2);
if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid,COLOR_ORED,"USAGE: /createorg [orgid] [genre] [name]");
if(orgid > MAX_ORGS) return SendClientMessage(playerid,COLOR_ORED,"Too high. Max org limitation exceed.");
new file[55];
format(file,sizeof file,"org%d.ini",orgid);
if(fexist(file)) return SendClientMessage(playerid,COLOR_ORED,"Organization ID already in use.");
if(orggenre > 3 || orggenre < 1) return SendClientMessage(playerid,COLOR_ORED,"Only 3 genre avaliable.");
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
dini_Create(file);
dini_Set(file,"Name",result);
dini_IntSet(file,"Genre",orggenre);
dini_IntSet(file,"Ammo",100);
new str2[256];
format(str2,256,"** You have created organization id %d, %s.",orgid,result);
SendClientMessage(playerid,COLOR_YELLOW,str2);
return 1;
}
if(strcmp(cmdtext,"/setorgveh",true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256],tmp2[256];
tmp = strtok(cmdtext,idx);
tmp2 = strtok(cmdtext,idx);
if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid,COLOR_ORED,"USAGE: /setorgveh [orgid] [car[1-8]]");
if(!IsNumeric(tmp) || !IsNumeric(tmp2)) return SendClientMessage(playerid,COLOR_ORED,"USAGE: /setorgveh [orgid] [car[1-8]]");
new filo[256];
new orgids = strval(tmp);
new cars = strval(tmp2);
if(cars > 8 || cars < 1) return SendClientMessage(playerid,COLOR_ORED,"Car ID 1-8");
format(filo,256,"org%d.ini",orgids);
if(!fexist(filo)) return SendClientMessage(playerid,COLOR_ORED,"Organization ID doesnt exist.");
new Float:X,Float:Y,Float:Z,Float:A;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_ORED,"You aren't in any vehicle.");
GetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),A);
if(cars == 1)
{
dini_IntSet(filo,"Model1",GetVehicleModel(GetPlayerVehicleID(playerid)));
dini_FloatSet(filo,"X1",X);
dini_FloatSet(filo,"Y1",Y);
dini_FloatSet(filo,"Z1",Z);
dini_FloatSet(filo,"A1",A);
OrgInfo[orgids][Car1] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A,-1,-1,-1);
}
if(cars == 2)
{
dini_IntSet(filo,"Model2",GetVehicleModel(GetPlayerVehicleID(playerid)));
dini_FloatSet(filo,"X2",X);
dini_FloatSet(filo,"Y2",Y);
dini_FloatSet(filo,"Z2",Z);
dini_FloatSet(filo,"A2",A);
OrgInfo[orgids][Car2] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A,-1,-1,-1);
}
if(cars == 3)
{
dini_IntSet(filo,"Model3",GetVehicleModel(GetPlayerVehicleID(playerid)));
dini_FloatSet(filo,"X3",X);
dini_FloatSet(filo,"Y3",Y);
dini_FloatSet(filo,"Z3",Z);
dini_FloatSet(filo,"A3",A);
OrgInfo[orgids][Car3] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A,-1,-1,-1);
}
if(cars == 4)
{
dini_IntSet(filo,"Model4",GetVehicleModel(GetPlayerVehicleID(playerid)));
dini_FloatSet(filo,"X4",X);
dini_FloatSet(filo,"Y4",Y);
dini_FloatSet(filo,"Z4",Z);
dini_FloatSet(filo,"A4",A);
OrgInfo[orgids][Car4] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A,-1,-1,-1);
}
if(cars == 5)
{
dini_IntSet(filo,"Model5",GetVehicleModel(GetPlayerVehicleID(playerid)));
dini_FloatSet(filo,"X5",X);
dini_FloatSet(filo,"Y5",Y);
dini_FloatSet(filo,"Z5",Z);
dini_FloatSet(filo,"A5",A);
OrgInfo[orgids][Car5] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A,-1,-1,-1);
}
if(cars == 6)
{
dini_IntSet(filo,"Model6",GetVehicleModel(GetPlayerVehicleID(playerid)));
dini_FloatSet(filo,"X6",X);
dini_FloatSet(filo,"Y6",Y);
dini_FloatSet(filo,"Z6",Z);
dini_FloatSet(filo,"A6",A);
OrgInfo[orgids][Car6] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A,-1,-1,-1);
}
if(cars == 7)
{
dini_IntSet(filo,"Model7",GetVehicleModel(GetPlayerVehicleID(playerid)));
dini_FloatSet(filo,"X7",X);
dini_FloatSet(filo,"Y7",Y);
dini_FloatSet(filo,"Z7",Z);
dini_FloatSet(filo,"A7",A);
OrgInfo[orgids][Car7] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A,-1,-1,-1);
}
if(cars == 8)
{
dini_IntSet(filo,"Model8",GetVehicleModel(GetPlayerVehicleID(playerid)));
dini_FloatSet(filo,"X8",X);
dini_FloatSet(filo,"Y8",Y);
dini_FloatSet(filo,"Z8",Z);
dini_FloatSet(filo,"A8",A);
OrgInfo[orgids][Car8] = CreateVehicle(GetVehicleModel(GetPlayerVehicleID(playerid)),X,Y,Z,A,-1,-1,-1);
}
new sl[256];
format(sl,256,"** You have set vehicle id %d to organization vehicle, %s (Carid:%d).",GetVehicleModel(GetPlayerVehicleID(playerid)),dini_Get(filo,"Name"),cars);
SendClientMessage(playerid,COLOR_MAIN,sl);
return 1;
}
if(strcmp(cmdtext,"/setorgskin", true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256],tmp2[256],tmp3[256];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext,idx);
tmp3 = strtok(cmdtext,idx);
if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3)) return SendClientMessage(playerid,COLOR_ORED,"USAGE: /setorgskin [ORGID] [Skin [1-2]] [SkinID]");
new orgido = strval(tmp);
new wichskin = strval(tmp2);
new skinid = strval(tmp3);
new filo[256];
format(filo,256,"org%d.ini",orgido);
if(!fexist(filo)) return SendClientMessage(playerid,COLOR_ORED,"Organization ID doesnt exist.");
if(wichskin < 1 || wichskin > 2) return SendClientMessage(playerid,COLOR_ORED,"Please choose between 1-2 for skin id.");
if(wichskin == 1)
{
dini_IntSet(filo,"Skin1",skinid);
}
if(wichskin == 2)
{
dini_IntSet(filo,"Skin2",skinid);
}
new stringo[256];
format(stringo,256,"** You have sucessfully changed the skin to skin id %d.",skinid);
SendClientMessage(playerid,COLOR_MAIN,stringo);
return 1;
}
if(strcmp(cmdtext,"/setorgcol",true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256],tmp2[256];
tmp = strtok(cmdtext,idx);
tmp2 = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_ORED,"USAGE: /setorgcol [orgid] [newcol]");
new format1[256];
new filo[256];
format(filo,256,"org%d.ini",strval(tmp));
if(!fexist(filo)) return SendClientMessage(playerid,COLOR_ORED,"Organization ID doesnt exist.");
format(format1,256,"** You have sucessfully change organization %s color id to %s.",dini_Get(filo,"Name"),tmp2);
SendClientMessage(playerid,COLOR_MAIN,format1);
dini_Set(filo,"Color",tmp2);
return 1;
}
if(strcmp(cmdtext,"/setorggenre",true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256],tmp2[256];
tmp = strtok(cmdtext,idx);
tmp2 = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_ORED,"USAGE: /setorggenre [orgid] [genre][1-3]");
if(!strlen(tmp2) || strval(tmp2) > 3 || strval(tmp2) < 1) return SendClientMessage(playerid,COLOR_ORED,"Genre 1-3");
if(OrgInfo[strval(tmp)][Genre] == strval(tmp2)) return SendClientMessage(playerid,COLOR_ORED,"That organization is already in this genre.");
new filo[256];
format(filo,55,"org%d.ini",strval(tmp));
if(!fexist(filo)) return SendClientMessage(playerid,COLOR_ORED,"Organization id doesnt exist.");
dini_IntSet(filo,"Genre",strval(tmp2));
OrgInfo[strval(tmp)][Genre] = strval(tmp2);
return 1;
}
if(strcmp(cmdtext,"/setorgcarcol",true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256],tmp2[256],tmp3[256];
tmp = strtok(cmdtext,idx);
tmp2 = strtok(cmdtext,idx);
tmp3 = strtok(cmdtext,idx);
if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3)) return SendClientMessage(playerid,COLOR_ORED,"USAGE: /setorgcol [orgid] [col1] [col2]");
new orgid12 = strval(tmp);
new col1 = strval(tmp2);
new col2 = strval(tmp3);
new filo[256];
format(filo,256,"org%d.ini",orgid12);
if(!fexist(filo)) return SendClientMessage(playerid,COLOR_ORED,"Organization ID doesnt exist.");
dini_IntSet(filo,"Col1",col1);
dini_IntSet(filo,"Col2",col2);
ChangeVehicleColor(OrgInfo[orgid12][Car1],col1,col2);
ChangeVehicleColor(OrgInfo[orgid12][Car2],col1,col2);
ChangeVehicleColor(OrgInfo[orgid12][Car3],col1,col2);
ChangeVehicleColor(OrgInfo[orgid12][Car4],col1,col2);
ChangeVehicleColor(OrgInfo[orgid12][Car5],col1,col2);
ChangeVehicleColor(OrgInfo[orgid12][Car6],col1,col2);
ChangeVehicleColor(OrgInfo[orgid12][Car7],col1,col2);
ChangeVehicleColor(OrgInfo[orgid12][Car8],col1,col2);
SendClientMessage(playerid,COLOR_ORED,"Sucessfully change vehicle color.");
return 1;
}
if(strcmp(cmdtext,"/setorgname",true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_ORED,"UASGE: /setorgname [OrgID] [New Name]");
new filo[256];
format(filo,256,"org%d.ini",strval(tmp));
if(!fexist(filo)) return SendClientMessage(playerid,COLOR_ORED,"That organization ID doesnt exist.");
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid,COLOR_ORED,"USAGE: /setorgname [OrgID] [New Name]");
dini_Set(filo,"Name",result);
new fm2[256];
format(fm2,256,"** You have sucessfully changed the organization name to %s.",result);
SendClientMessage(playerid,COLOR_MAIN,fm2);
return 1;
}
if(strcmp(cmdtext, "/oc", true) == 0)
{
if(PlayerInfo[playerid][Member] == -255) return 0;
new length = strlen(cmdtext);
new playrname[MAX_PLAYERS];
new string[256];
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oc [text]");
GetPlayerName(playerid, playrname, sizeof(playrname));
format(string,sizeof(string),"OrgChat - %s : %s", playrname,result);
if(PlayerInfo[playerid][Member] != -255)
{
for(new i=0;i<MAX_PLAYERS;i++)
{ if(IsPlayerConnected(i) && PlayerInfo[i][Member] == PlayerInfo[playerid][Member])
SendClientMessage(i,COLOR_MAIN,string);
}
}
return 1;
}
if(strcmp(cmdtext,"/invite",true) == 0)
{
new tmp[256];
new filo[55];
tmp = strtok(cmdtext, idx);
if(PlayerInfo[playerid][Member] == 0) return 0;
new ID = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_ORED,"USAGE: /setmember [ID]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,COLOR_ORED,"That folllowing player is not connected!");
if(PlayerInfo[playerid][Member] != -255) return SendClientMessage(playerid,COLOR_ORED,"That player is already in an organization.");
PlayerInfo[playerid][Member] = PlayerInfo[playerid][Member];
request[ID] = -255;
PlayerInfo[playerid][Leader] = 0;
SendClientMessage(ID,COLOR_MAIN,"The organization leader has invited you in his org.");
SendClientMessage(playerid,COLOR_GREEN,"You have accepted that following player into your organization.");
SetPlayerColor(ID,HexToInt(dini_Get(filo,"Color")));
return 1;
}
if(strcmp(cmdtext,"/resign",true) == 0)
{
if(PlayerInfo[playerid][Member] == -255) return 0;
if(PlayerInfo[playerid][Leader] == 1)
{
SendClientMessage(playerid,COLOR_ORED,"You are a leader. You cant resign from your organization. Get an admin to remove your leadership and set a new leader for this organization.");
return 1;
}
SendClientMessage(playerid,COLOR_YELLOW,"** You have sucessfully resigned from your organization.");
SetPlayerColor(playerid,0xFFFFFFFF); //Default color for orgless players
SetPlayerSkin(playerid,0); //You can set any skin you want..
PlayerInfo[playerid][Member] = -255;
return 1;
}
if(strcmp(cmdtext,"/setleaderopi",true) == 0)
{
new tmp[256], tmp2[256];
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
if(!strlen(tmp) || !strlen(tmp2))
{
SendClientMessage(playerid,COLOR_ORED,"USAGE: /setleader [ID] [OrgID]");
return 1;
}
new ID = strval(tmp);
new OrgID = strval(tmp2);
new Count = strval(tmp2);
new filo[256];
format(filo,sizeof(filo),"org%d.ini",OrgID);
if(PlayerInfo[playerid][Member] != -255) return SendClientMessage(playerid,COLOR_ORED,"You can't set a leader that is in an organization.");
if(!fexist(filo)) return SendClientMessage(playerid,COLOR_ORED,"Organization IDs never exist.");
new form[256];
new nama[55];
new nama2[55];
GetPlayerName(ID,nama2,55);
GetPlayerName(playerid,nama,55);
format(form,sizeof(form),"** Admin %s has set you the leader of %s.",nama,dini_Get(filo,"Name"));
SendClientMessage(ID,COLOR_YELLOW,form);
OrgInfo[OrgID][Count]++;
PlayerInfo[playerid][Member] = OrgID;
PlayerInfo[playerid][Leader] = 1;
request[ID] = -255;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
for(new i = 0;i<MAX_ORGS;i++)
{
if(newstate == 2)
{
new filo[55];
format(filo,55,"org%d.ini",i);
if(OrgInfo[i][Car1] == GetPlayerVehicleID(playerid))
{
if(PlayerInfo[playerid][Member] != i)
{
new str[256];
format(str,sizeof(str),"** Error: You cannot drive a vehicle that belongs to %s.",dini_Get(filo,"Name"));
SendClientMessage(playerid,COLOR_ORED,str);
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(OrgInfo[i][Car2] == GetPlayerVehicleID(playerid))
{
if(PlayerInfo[playerid][Member] != i)
{
new str[256];
format(str,sizeof(str),"** Error: You cannot drive a vehicle that belongs to %s.",dini_Get(filo,"Name"));
SendClientMessage(playerid,COLOR_ORED,str);
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(OrgInfo[i][Car8] == GetPlayerVehicleID(playerid))
{
if(PlayerInfo[playerid][Member] != i)
{
new str[256];
format(str,sizeof(str),"** Error: You cannot drive a vehicle that belongs to %s.",dini_Get(filo,"Name"));
SendClientMessage(playerid,COLOR_ORED,str);
RemovePlayerFromVehicle(playerid);
}
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[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
// stocks
When i type /createorg, it says orgname orgid orggenre
and When i type /createorg SAPD 1 3 then it doesn't works
all cmds i made are like this bug, pls if you know what is the bug in these cmds then pls fix it and give me the correct code.