17.06.2012, 15:29
Hi i got 3 errors and a lot of warnings i have no clue how to fix them:
pawn Код:
//=======================[INCLUDES]==========================================================//
#include <a_samp>
#include <zcmd>
#include <streamer>
#include <sscanf2>
#include <dini>
//========================[COLOUR DEFINES]===========================================================//
#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
//=======================[DIALOG DEFINES]==========================================================//
#define DIALOG_ESHOP 1
#define DIALOG_RSHOP 2
//===================[TEAM DEFINES]===========================================================//
#define England 1
#define Russia 2
//=========================[FORWADS]=======================================================//
forward OnPlayerEnterDynamicArea(playerid, areaid);
//=========================[BOOLS]===========================================================//
//============================[STOCKS]======================================================//
stock PlayerName(playerid) {
new pName[24];
GetPlayerName(playerid,pName,24);
return pName;
}
//=========================================================================================//
new englandzone;
new russiazone;
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
SetGameModeText("FatTDM");
//==============================[CLASES]==================================================//
AddPlayerClass(121,226.7424,1931.4076,17.6406,265.3649,0,0,0,0,0,0); // englandpos1
AddPlayerClass(179,204.5247,1869.6681,13.1406,274.2833,0,0,0,0,0,0); // englandpos2
AddPlayerClass(217,209.3599,1855.4443,20.2765,356.2324,0,0,0,0,0,0); // englandpos3
AddPlayerClass(101,-347.0208,1570.8115,75.9954,179.4697,0,0,0,0,0,0); // russiapos1
AddPlayerClass(73,-309.2180,1537.6707,75.5625,133.7227,0,0,0,0,0,0); // russiapos2
//========================================================================================//
englandzone = CreateDynamicRectangle(284.8186, 1805.9808, 97.5450, 1940.9124, -1, -1, -1);
russiazone = CreateDynamicRectangle(-202.8799, 1385.0337, -383.7028, 1631.0679, -1, -1, -1);
return 1;
}
enum gPInfo
{
Padmin,
Preg,
Ploged,
Banned,
Level,
}
new PInfo[MAX_PLAYERS][gPInfo];
public OnGameModeExit()
{
return 1;
}
new Team[MAX_PLAYERS] = -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:
{
GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
Team[playerid] = 1;
}
case 1:
{
GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
Team[playerid] = 1;
}
case 2:
{
GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
Team[playerid] = 1;
}
case 3:
{
GameTextForPlayer(playerid, "~P~Russia", 1000, 6);
Team[playerid] = 2;
}
case 4:
{
GameTextForPlayer(playerid, "~P~Russia", 1000, 6);
Team[playerid] = 2;
}
}
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 0:
{
GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
Team[playerid] = 1;
}
case 1:
{
GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
Team[playerid] = 1;
}
case 2:
{
GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
Team[playerid] = 1;
}
case 3:
{
GameTextForPlayer(playerid, "~p~Russia", 1000, 6);
Team[playerid] = 2;
}
case 4:
{
GameTextForPlayer(playerid, "~p~Russia", 1000, 6);
Team[playerid] = 2;
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
new string[128];
format(string, sizeof(string), "%s[%d] Has joined FatTDM", PlayerName(playerid), playerid);
SendClientMessageToAll(-1, string);
PInfo[playerid][Padmin] = 0;
new name[MAX_PLAYERS], file[256];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),"FatAdmin/Users/%s.ini",name);
if(dini_Exists(file))
{
SendClientMessage(playerid, -1, "Your account has been loaded form our daterbase you may now /login");
PInfo[playerid][Preg] =1;
PInfo[playerid][Ploged] =0;
PInfo[playerid][Banned] =0;
return 1;
}
if(!dini_Exists(file))
{
SendClientMessage(playerid, -1, "You need to register /register");
PInfo[playerid][Preg] =0;
PInfo[playerid][Ploged] =0;
PInfo[playerid][Banned] =0;
return 1;
}
if(dini_Exists(file))
{
SendClientMessage(playerid, COLOR_RED, "you are banned from this server goodbye");
PInfo[playerid][Preg] =0;
PInfo[playerid][Ploged] =0;
PInfo[playerid][Banned] =1;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file),"FatAdmin/Users/%s.ini,name");
PInfo[playerid][Ploged] =0;
if(dini_Exists(file))
{
dini_IntSet(file,"PLoged",0);
return 1;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
new englandcp;
new russiancp;
SetPlayerInterior(playerid, 0);
englandcp = CreateDynamicCP(247.9255,1859.3064,14.0840, 2, -1, -1, -1);
russiancp =CreateDynamicCP(-340.0471,1543.2358,75.5625, 2, -1, -1, -1);
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 OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
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;
}
//=============================[COMMANDS]============================================//
CMD:pm(playerid, params[])
{
new string[50];
new sent[128];
new id;
if(sscanf(params,"us[50]",id,string)) return SendClientMessage(playerid, COLOR_PURPLE, "USGAE: /pm <id> <message>");
format(string, sizeof(string),"**PM From %s**: {690069}%s", PlayerName(playerid), string);
format(sent, sizeof(sent),"Message: Sent to %s", PlayerName(id));
SendClientMessage(playerid, COLOR_LIGHTGREEN, sent);
SendClientMessage(id, COLOR_PURPLE, string);
GameTextForPlayer(playerid, "~r~Message ~b~Sent", 2000, 1);
GameTextForPlayer(id, "~r~New Message ~b~Recived", 2000, 1);
PlayerPlaySound(playerid, 1057, 0, 0, 0);
PlayerPlaySound(id, 1057, 0, 0, 0);
return 1;
}
CMD:reg(playerid, params[])
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file),"FatAdmin/Users/%s.ini",name);
if(dini_Exists(file)) return SendClientMessage(playerid, -1, "You have already registered!");
if(PInfo[playerid][Preg] == 1) return SendClientMessage(playerid, -1, "you have registered!");
if(PInfo[playerid][Ploged] == 1) return SendClientMessage(playerid, -1, "you have already loged in");
if(strlen(params))
{
if(!dini_Exists(file))
{
dini_Create(file);
dini_Set(file,"password", params);
dini_IntSet(file,"Preg", 0);
dini_IntSet(file,"PLoged",0);
dini_IntSet(file,"Padmin",0);
PInfo[playerid][Preg] = 1;
return SendClientMessage(playerid, -1, "congrats you registered");
}
else
{
SendClientMessage(playerid, -1, "USAGE: /reg <password>");
return 1;
}
}
return 1;
}
CMD:login(playerid, params[])
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid,name, sizeof(name));
format(file, sizeof(file), "FatAdmin/Users/%s.ini",name);
if(!dini_Exists(file)) return SendClientMessage(playerid,-1,"You are not registered! Please /register");
if(PInfo[playerid][Ploged] == 1) return SendClientMessage(playerid,-1,"You are already logged in!");
if(PInfo[playerid][Preg] == 0) return SendClientMessage(playerid,-1,"You are not registered! Please /register");
if(strlen(params))
{
new pass[256];
pass = dini_Get(file, "password");
if(dini_Exists(file))
{
if(strcmp(params,pass,false) != 0)
{
SendClientMessage(playerid,-1,"Wrong Password!");
}
else
{
dini_IntSet(file,"Logged",1);
PInfo[playerid][Ploged] = 1;
PInfo[playerid][Level] = dini_Int(file,"Level");
SendClientMessage(playerid,-1,"You have now logged in!");
return 1;
}
}
}
else
{
SendClientMessage(playerid,-1,"USAGE: /login <Password>");
return 1;
}
return 1;
}
//==========================[ADMIN SYSTEM]=========================================//
CMD:achat(playerid, params[])
{
new msg[50];
if(sscanf(params,"s[50]",msg)) return SendClientMessage(playerid, -1, "USAGE: /achat <message>");
format(msg, sizeof(msg),"[ADMIN]: %s",msg);
SendClientMessageToAll(COLOR_BLUE1, msg);
return 1;
}
CMD:fchat(playerid, params[])
{
new id;
new color;
new msg[50];
color = GetPlayerColor(id);
if(sscanf(params,"us[50]",id,msg)) return SendClientMessage(playerid, -1, "USAGE: /fchat <id> <message>");
format(msg, sizeof(msg),"%s %s",PlayerName(id),msg);
SendClientMessageToAll(color, msg);
return 1;
}
CMD:setlvl(playerid, params[])
{
new id;
new lvl;
new name[MAX_PLAYER_NAME];
new file[128];
new string[128];
new string2[128];
if(sscanf(params,"ui",id,lvl)) return SendClientMessage(playerid, -1, "USAGE: /setlvl <id> <lvl>");
GetPlayerName(id,name,sizeof(name));
format(file, sizeof(file),"FatAdmin/Users/%s.ini",name);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not an RCON admin!");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"invaild id");
PInfo[id][Padmin] = lvl;
dini_IntSet(file,"Padmin", lvl);
format(string2, sizeof(string),"you have been given a admin lvl of %d by %s", lvl, name);
SendClientMessage(id, -1, string2);
format(string, sizeof(string),"you have set %s to admin level %d", name, lvl);
SendClientMessage(playerid, -1,string);
return 1;
}
CMD:kick(playerid, params[]) {
new ID, reason[24], string[128];
if(PInfo[playerid][Padmin] == 1) return true;
else if(sscanf(params,"us[24]",ID,reason)) return SendClientMessage(playerid,0xA70000FF,"Syntax: /Kick [ID] [Reason].");
format(string,sizeof(string),"You've kicked %s for reason: %s.",PlayerName(ID),reason);
SendClientMessage(playerid,0xFFFFFFFF,string);
format(string,sizeof(string),"You've been kicked by %s for reason: %s.",PlayerName(playerid),reason);
SendClientMessage(ID,0xFFFFFFFF,string);
Kick(ID);
return true;
}
CMD:setscore(playerid, params[])
{
new id;
new score;
new msg[128];
new msg2[128];
if(PInfo[playerid][Padmin] == 3) return true;
else if(sscanf(params,"ui", id, score)) return SendClientMessage(playerid, -1, "USAGE: /setscore <id> <score>");
SetPlayerScore(id,score);
format(msg, sizeof(msg), "you have set %s score to %d", PlayerName(id), score);
format(msg2, sizeof(msg), "your score has been set by %s to score %d", PlayerName(playerid), score);
SendClientMessage(playerid, -1, msg);
SendClientMessage(id, -1, msg2);
PlayerPlaySound(id, 5450, 0, 0, 0);
PlayerPlaySound(playerid, 5201, 0, 0, 0);
return 1;
}
CMD:givewep(playerid, params[])
{
new id;
new gunid;
new wepstring[128];
new wepstring2[128];
if(PInfo[playerid][Padmin] == 3) return true;
else if(sscanf(params,"ui",id,gunid)) return SendClientMessage(playerid, -1, "usage: /givewep <id> <wepid>");
GivePlayerWeapon(id, gunid, 500);
format(wepstring, sizeof(wepstring), "you have given %s a gun", PlayerName(id));
format(wepstring2, sizeof(wepstring2), "you have been given a gun by %s", PlayerName(playerid));
SendClientMessage(playerid, -1, wepstring);
SendClientMessage(id, -1, wepstring2);
return 1;
}
CMD:explode(playerid, params[])
{
new id;
new allstring[128];
new mestring[128];
new youstring[128];
new Float:X, Float:Y, Float:Z;
if(PInfo[playerid][Padmin] == 3) return true;
else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /explode [id]");
GetPlayerPos(id, X, Y, Z);
CreateExplosion(X, Y, Z, 0, 1);
format(allstring, sizeof(allstring), "%s has exploded %s", PlayerName(playerid), PlayerName(id));
format(mestring, sizeof(mestring), "you have exploded %s", PlayerName(id));
format(youstring, sizeof(youstring), "you have been exploded by %s", PlayerName(playerid));
SendClientMessageToAll(-1, allstring);
SendClientMessage(playerid, -1, mestring);
SendClientMessage(id, -1, youstring);
return 1;
}
CMD:ann(playerid, params[])
{
new text[50];
if(PInfo[playerid][Padmin] == 1) return true;
else if(sscanf(params,"s[50]",text)) return SendClientMessage(playerid, -1, "USAGE: /ann [text]");
GameTextForAll(text, 10000, 6);
return 1;
}
CMD:gethere(playerid, params[])
{
new id;
new Float:X, Float:Y, Float:Z;
new string[128];
new string2[128];
if(PInfo[playerid][Padmin] == 1) return true;
else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /gethere [id]");
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(id, X, Y, Z);
format(string, sizeof(string), "you have teleported %s to your position", PlayerName(id));
format(string2, sizeof(string2), "you have been teleported to %s's position", PlayerName(playerid));
SendClientMessage(playerid, -1, string);
SendClientMessage(id, -1, string2);
return 1;
}
CMD:freeze(playerid, params[])
{
new id;
new string[128];
new string2[128];
if(PInfo[playerid][Padmin] == 1) return true;
else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /freeze [id]");
TogglePlayerControllable(id, 0);
format(string, sizeof(string), "you have frozen %s", PlayerName(id));
format(string2, sizeof(string2), "you have been frozen by %s", PlayerName(playerid));
SendClientMessage(playerid, -1, string);
SendClientMessage(id, -1, string2);
return 1;
}
CMD:unfreeze(playerid, params[])
{
new id;
new string[128];
new string2[128];
if(PInfo[playerid][Padmin] == 1) return true;
else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /unfreeze [id]");
TogglePlayerControllable(id, 1);
format(string, sizeof(string), "you have unfrozen %s", PlayerName(id));
format(string2, sizeof(string2), "you have been unfrozen by %s", PlayerName(playerid));
SendClientMessage(playerid, -1, string);
SendClientMessage(id, -1, string2);
return 1;
}
CMD:setskin(playerid, params[])
{
new id;
new skinid;
new string[128];
new string2[128];
if(PInfo[playerid][Padmin] == 1) return true;
else if(sscanf(params,"ui",id,skinid)) return SendClientMessage(playerid, -1, "USAGE: /setskin [id] [skinid]");
SetPlayerSkin(id, skinid);
format(string, sizeof(string), "you have made %s skin id %d",PlayerName(id),skinid);
format(string2, sizeof(string2), "your skin has been set to %d by %s", skinid, PlayerName(playerid));
SendClientMessage(playerid, -1, string);
SendClientMessage(id, -1, string2);
return 1;
}
CMD:fine(playerid, params[])
{
new id;
new ammount;
new string[128];
new string2[128];
if(PInfo[playerid][Padmin] == 1) return true;
else if(sscanf(params,"ui",id,ammount)) return SendClientMessage(playerid, -1, "USAGE: /fine [id] [ammount]");
GivePlayerMoney(id, -ammount);
format(string, sizeof(string), "you have fined %s $%d",PlayerName(id),ammount);
format(string2, sizeof(string2), "you have been fined by %s for $%d", PlayerName(playerid), ammount);
SendClientMessage(playerid, -1, string);
SendClientMessage(id, -1, string2);
return 1;
}
CMD:time(playerid, params[])
{
new time;
new string[128];
new string2[128];
if(PInfo[playerid][Padmin] == 1) return true;
else if(sscanf(params,"i",time)) return SendClientMessage(playerid, -1, "USAGE: /time [00:00-23:00]");
SetWorldTime(time);
format(string, sizeof(string), "you have set the time to %d",time);
format(string2, sizeof(string2), "%s has set the time to %d", PlayerName(playerid), time);
SendClientMessage(playerid, -1, string);
SendClientMessageToAll(-1, string2);
return 1;
}
CMD:ban(playerid, params[])
{
new ID;
new reason[26];
new banmsg[128];
new done[120];
new banhim[125];
new file;
if(PInfo[playerid][Padmin] == 1) return true;
else if(sscanf(params,"us[26]",ID,reason)) return SendClientMessage(playerid, -1, "USAGE /ban [id] [reason] ");
format(banmsg, sizeof(banmsg), "%s has banned %s for reason: %s", PlayerName(playerid), PlayerName(ID), reason);
format(done, sizeof(done), "you have banned %s for reason: %s", PlayerName(ID), reason);
format(banhim, sizeof(banhim), "you have been banned by %s for reason: %s", PlayerName(playerid), reason);
SendClientMessageToAll(-1, banmsg);
format(file, sizeof(file),"FatAdmin/Users/%s.ini",PlayerName(ID));
dini_IntSet(file,"Banned", 1);
SendClientMessage(playerid, -1, done);
SendClientMessage(ID, -1, banhim);
Ban(ID);
return 1;
}