07.05.2011, 17:39
Hello i got this script:
But i am getting these errors, can any of you guys help me? i am getting these errors:
pawn Код:
/* Project Civil War bye Justsomeguy and Marilem.
This project is about making an change into the world of TDM and finally,
Not an RP server cuz it is sow overused.
The server will be more uniqeu then others as this one is made from scratch.
note to self:
#watch this vid:
[ame]http://www.youtube.com/watch?v=xWYdJQGiDFQ[/ame]
#Fix register system.
#Make an group system(NORTH AMERICA V/S SOUTH AMERICA).
*/
#include <a_samp>
#include <streamer>
#include <COLORS>
#include <dini>
#include <dudb>
#include <utils>
#include "../include/gl_common.inc"
#define SERVER_USER_FILE "Civil War userfile/%s.ini"
///TEAMS
#define SOUTH 1
#define NORTH 2
#define SCM SendClientMessage
#define SCMT SendClientMessageToAll
/*Holding object defines */
#define WEAPON_TYPE_NONE (0)
#define WEAPON_TYPE_HEAVY (1)
#define WEAPON_TYPE_LIGHT (2)
#define WEAPON_TYPE_MELEE (3)//Nahkampf
#define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9)
#define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
#define MAX_OBJ 50 // Limit
new Purgotary[MAX_PLAYERS];
forward purgotary(playerid);
forward AntiSpawnKill(playerid);
new Text:Textdraw;
new Kills[MAX_PLAYERS];
new Deaths[MAX_PLAYERS];
new gTeam[MAX_PLAYERS];
new isLogged[MAX_PLAYERS];
new Level[MAX_PLAYERS];
new Admin[MAX_PLAYERS];
new isMuted[MAX_PLAYERS];
new Warns[MAX_PLAYERS];
new SkillPoints[MAX_PLAYERS];
new Deagle[MAX_PLAYERS];
new Shotgun[MAX_PLAYERS];
new Spas[MAX_PLAYERS];
new MP5[MAX_PLAYERS];
new Ak47[MAX_PLAYERS];
new M4[MAX_PLAYERS];
new Sniper[MAX_PLAYERS];
new Text3D:admlabl[MAX_PLAYERS];
// -----------------------------------------------------------------------------
new Float:ObjCoords[MAX_OBJ][3];
new object[MAX_OBJ];
new ObjectID[MAX_OBJ][2];
// -----------------------------------------------------------------------------
new GunNames[48][] = {
"Nothink",
"Brass Knuckles",
"Golf Club",
"Nitestick",
"Knife",
"Baseball Bat",
"Showel",
"Pool Cue",
"Katana",
"Chainsaw",
"Purple Dildo",
"Small White Dildo",
"Long White Dildo",
"Vibrator",
"Flowers",
"Cane",
"Grenade",
"Tear Gas",
"Molotov",
"Vehicle Missile",
"Hydra Flare",
"Jetpack",
"Glock",
"Silenced Colt",
"Desert Eagle",
"Shotgun",
"Sawn Off",
"Combat Shotgun",
"Micro UZI",
"MP5",
"AK47",
"M4",
"Tec9",
"Rifle",
"Sniper Rifle",
"Rocket Launcher",
"HS Rocket Launcher",
"Flamethrower",
"Minigun",
"Satchel Charge",
"Detonator",
"Spraycan",
"Fire Extinguisher",
"Camera",
"Nightvision",
"Infrared Vision",
"Parachute",
"Fake Pistol"
};
// -----------------------------------------------------------------------------
new GunObjects[47][0] = { // © gimini
{0},// Emty
{331},// Brass Knuckles
{333},// Golf Club
{334},// Nitestick
{335},// Knife
{336},// Baseball Bat
{337},// Showel
{338},// Pool Cue
{339},// Katana
{341},// Chainsaw
{321},// Purple Dildo
{322},// Small White Dildo
{323},// Long White Dildo
{324},// Vibrator
{325},// Flowers
{326},// Cane
{342},// Grenade
{343},// Tear Gas
{344},// Molotov
{0},
{0},
{0},
{346},// Glock
{347},// Silenced Colt
{348},// Desert Eagle
{349},// Shotgun
{350},// Sawn Off
{351},// Combat Shotgun
{352},// Micro UZI
{353},// MP5
{355},// AK47
{356},// M4
{372},// Tec9
{357},// Rifle
{358},// Sniper Rifle
{359},// Rocket Launcher
{360},// HS Rocket Launcher
{361},// Flamethrower
{362},// Minigun
{363},// Detonator
{364},// Detonator Button
{365},// Spraycan
{366},// Fire Extinguisher
{367},// Camera
{368},// Nightvision
{368},// Infrared Vision
{371}// Parachute
};
#pragma unused ret_memcpy
new OldWeapon[MAX_PLAYERS];
new HoldingWeapon[MAX_PLAYERS];
enum pInfo
{
pAdminLevel,
pCash,
pScore,
pDeaths,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
main()
{
print("\n----------------------------------------");
print(" Civil War TDM by Justsomeguy and Marilem");
print("----------------------------------\n");
}
public OnGameModeInit()
{
Textdraw = TextDrawCreate( 1.000000,300.000000,"You died, please wait to be send back to life." );
TextDrawAlignment( Textdraw, 0 );
TextDrawBackgroundColor( Textdraw, 0x000000ff );
TextDrawFont( Textdraw, 0 );
TextDrawLetterSize( Textdraw, 1.1,4.1 );
TextDrawColor( Textdraw, COLOR_RED );
TextDrawSetOutline( Textdraw, 1 );
TextDrawSetProportional( Textdraw, 1 );
TextDrawSetShadow( Textdraw, 1 );
// Don't use these lines if it's a filterscript
SetGameModeText("Civil war TDM");
// CHANGE SKINS FOR YOUR TEAMS HERE
AddPlayerClass(281,1597.8793,-1706.9119,5.8906,48.5541,0,0,0,0,0,0); // NORTH
AddPlayerClass(280,1597.8793,-1706.9119,5.8906,48.5541,0,0,0,0,0,0); //NORTH
AddPlayerClass(283,1597.8793,-1706.9119,5.8906,48.5541,0,0,0,0,0,0); //NORTH
AddPlayerClass(284,1597.8793,-1706.9119,5.8906,48.5541,0,0,0,0,0,0); //NORTH
AddPlayerClass(285,1597.8793,-1706.9119,5.8906,48.5541,0,0,0,0,0,0); //NORTH
AddPlayerClass(274,1177.4844,-1323.8638,14.0730,269.5144,0,0,0,0,0,0); //SOUTH
AddPlayerClass(275,1177.4844,-1323.8638,14.0730,269.5144,0,0,0,0,0,0); //SOUTH
AddPlayerClass(276,1177.4844,-1323.8638,14.0730,269.5144,0,0,0,0,0,0); //SOUTH
AddPlayerClass(277,1177.4844,-1323.8638,14.0730,269.5144,0,0,0,0,0,0); //SOUTH
AddPlayerClass(278,1177.4844,-1323.8638,14.0730,269.5144,0,0,0,0,0,0); //SOUTH
AddPlayerClass(279,1177.4844,-1323.8638,14.0730,269.5144,0,0,0,0,0,0); //SOUTH
DisableInteriorEnterExits();
return 1;
}
public OnGameModeExit()
{
for(new i=0;i<MAX_PLAYERS;i++)
if(IsPlayerConnected(i))
StopPlayerHoldingObject(i);
if(isLogged[i] == 1) //SAVE ON CRASH/RESTART
{
new name[256],check[256];
Delete3DTextLabel(levl[i]);
Delete3DTextLabel(admlabl[i]);
GetPlayerName(i, name, sizeof(name));
format(check, sizeof(check), "%s.ini", name);
dini_IntSet(check,"kills", Kills[i]);
dini_IntSet(check,"deaths", Deaths[i]);
dini_IntSet(check,"money", GetPlayerMoney(i));
dini_IntSet(check,"level", Level[i]);
dini_IntSet(check,"admin", Admin[i]);
dini_IntSet(check,"warns", Warns[i]);
dini_IntSet(check,"skill_deagle", Deagle[i]);
dini_IntSet(check,"skill_shotgun", Shotgun[i]);
dini_IntSet(check,"skill_spas", Spas[i]);
dini_IntSet(check,"skill_mp5", MP5[i]);
dini_IntSet(check,"skill_ak", Ak47[i]);
dini_IntSet(check,"skill_m4", M4[i]);
dini_IntSet(check,"skill_sniper", Sniper[i]);
dini_IntSet(check,"SkillPoints", SkillPoints[i]);
}
}
TextDrawDestroy(Textdraw);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1867.2502,-1362.7205,19.1406);
SetPlayerCameraPos(playerid, 1872.0940,-1362.6853,19.1406);
SetPlayerCameraLookAt(playerid, 1867.2502,-1362.7205,19.1406);
SetPlayerFacingAngle(playerid, 268.1415);
//CHANGE TEAM NAMES HERE
if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4)
{
gTeam[playerid] = LSPD;
GameTextForPlayer(playerid, "LSPD", 1000, 3);
}
else if(classid == 5 || classid == 6 || classid == 7 || classid == 8 || classid == 9 || classid == 10)
{
gTeam[playerid] = EMS;
GameTextForPlayer(playerid, "EMS", 1000, 3);
}
return 1;
}
public OnPlayerConnect(playerid)
{
Purgotary[playerid] = 0;
new string[64], pName[MAX_PLAYER_NAME], string2[64];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof(string),"Player %s has been connected",pName);
format(string2, sizeof(string2), "%s.ini", pName);
SendClientMessageToAll(0xFFFFFFAA,string);
SendClientMessage(playerid, 0xFFFFFFAA, "Welcome to TDM Advanced mod by rockstar (not Rockstar Games)"); //Write your MOTD here
isLogged[playerid] = 0;
Admin[playerid] = 0;
Level[playerid] = 0;
Deaths[playerid] = 0;
Kills[playerid] = 0;
SkillPoints[playerid] = 0;
if(!dini_Exists(string2))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register new account", "Account with this name is not registred!\nType your new password here:", "Register", "Exit");
}
else ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Log in your account", "This account is registred!\nType your password below:", "Login", "Exit");
}
GameTextForPlayer(playerid," ~Y~welcome to ~B~Civil War ~R~TDM", 25, 1000);
OldWeapon[playerid]=0;
HoldingWeapon[playerid]=0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new string[64], name[MAX_PLAYER_NAME], check[256];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"Player %s left the server(game crash)",name);
case 1: format(string,sizeof string,"Player %s left the server",name);
}
SendClientMessageToAll(0x757575AA,string);
format(check, sizeof(check), "%s.ini", name);
new cash;
cash = GetPlayerMoney(playerid);
if(isLogged[playerid] == 1)
{
dini_IntSet(check,"kills", Kills[playerid]);
dini_IntSet(check,"deaths", Deaths[playerid]);
dini_IntSet(check,"money", cash);
dini_IntSet(check,"skill_deagle", Deagle[playerid]);
dini_IntSet(check,"skill_shotgun", Shotgun[playerid]);
dini_IntSet(check,"skill_spas", Spas[playerid]);
dini_IntSet(check,"skill_mp5", MP5[playerid]);
dini_IntSet(check,"skill_ak", Ak47[playerid]);
dini_IntSet(check,"skill_m4", M4[playerid]);
dini_IntSet(check,"skill_sniper", Sniper[playerid]);
dini_IntSet(check,"SkillPoints", SkillPoints[playerid]);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/dropgun", true) == 0 || strcmp(cmd, "/dgun", true) == 0)
{
new gunID = GetPlayerWeapon(playerid);
new gunAmmo = GetPlayerAmmo(playerid);
if(gunID != 0 && gunAmmo != 0)
{
new f = MAX_OBJ+1;
for(new a = 0; a < sizeof(ObjCoords); a++)
{
if(ObjCoords[a][0] == 0.0)
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "You can not throw weapons at the moment, try back later!!");
new gunname[25];
new buffer[100];
GetWeaponNameEx(gunID, gunname, sizeof(gunname));
format(buffer, sizeof(buffer), "You threw %s", gunname);
SendClientMessage(playerid, 0x33AA3300, buffer);
RemovePlayerWeapon(playerid, gunID);
ObjectID[f][0] = gunID;
ObjectID[f][1] = gunAmmo;
GetPlayerPos(playerid, ObjCoords[f][0], ObjCoords[f][1], ObjCoords[f][2]);
object[f] = CreateObject(GunObjects[gunID][0],ObjCoords[f][0],ObjCoords[f][1],ObjCoords[f][2]-1,93.7,120.0,120.0);
return 1;
}
}
if(strcmp(cmd, "/pickupgun", true) == 0 || strcmp(cmd, "/pgun", true) == 0)
{
new f = MAX_OBJ+1;
for(new a = 0; a < sizeof(ObjCoords); a++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, ObjCoords[a][0], ObjCoords[a][1], ObjCoords[a][2]))
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "You are not near the weapon which you can pick up!");
else
{
new gunname[25];
new buffer[100];
ObjCoords[f][0] = 0.0;
ObjCoords[f][1] = 0.0;
ObjCoords[f][2] = 0.0;
DestroyObject(object[f]);
GivePlayerWeapon(playerid, ObjectID[f][0], ObjectID[f][1]);
GetWeaponNameEx(ObjectID[f][0], gunname, sizeof(gunname));
format(buffer, sizeof(buffer), "You picked up %s", gunname);
SendClientMessage(playerid, 0x33AA3300, buffer);
}
return 1;
}
if (strcmp("/Goodbyecruelworld!", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid, 0);
return 1;
}
if (strcmp("/Heal", cmdtext, true, 10) == 0)
{
GetPlayerMoney( 2000);
SetPlayerHealth(playerid, 100);
return 1;
}
if (strcmp("/Buyarmor", cmdtext, true, 10) == 0)
{
GetPlayerMoney( 4200);
SetPlayerArmour(playerid, 1000);
return 1;
}
if(strcmp("/stats", cmdtext, true) == 0)
{
new name[24], check[258], stats[256];
GetPlayerName(playerid, name, sizeof(name));
format(check, sizeof(check), "%s.ini", name);
if(dini_Exists(check))
{
SendClientMessage(playerid, 0xFFFFFFAA, "____________STATS___________");
format(stats, sizeof(stats), "Money: [%i$] Kills: [%i] Deaths: [%i]\nLevel: [%i] Admin Level: [%i] Warns: [%i]", GetPlayerMoney(playerid), Kills[playerid], Deaths[playerid], Level[playerid], Admin[playerid], Warns[playerid]);
SendClientMessage(playerid, 0xFFFFFFAA, stats);
}
return 1;
}
if(strcmp("/pm", cmd, true) == 0)
{
new messagavic[256], messagame[256], pname[24], vname[24];
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(strval(tmp), vname, sizeof(vname));
if(strval(tmp) > 9)
{
format(messagavic, sizeof(messagavic), "PM from %s(%i): %s", pname ,playerid, cmdtext[6]);
format(messagame, sizeof(messagame), "PM for %s(%i): %s", vname, strval(tmp), cmdtext[6]);
}
else
{
format(messagavic, sizeof(messagavic), "PM from %s(%i): %s", pname,playerid, cmdtext[5]);
format(messagame, sizeof(messagame), "PM for %s(%i): %s", vname, strval(tmp), cmdtext[5]);
}
if(!strlen(tmp))
{
SCM(playerid, 0xFFFFFFAA, "USAGE: /pm [id] [message]");
}
else
{
SCM(strval(tmp), 0xFFFF00AA, messagavic);
SCM(playerid, 0xE1E100AA, messagame);
}
return 1;
}
if(strcmp("/help", cmd, true) == 0)
{
SCM(playerid, 0xFFFFFFAA, "____________HELP______________");
SCM(playerid, 0xFFFFFFAA, "/stats - your statistic.");
SCM(playerid, 0xFFFFFFAA, "/pm [ID] [text] - personal message.");
SCM(playerid, 0xFFFFFFAA, "![text] - team chat.");
SCM(playerid, 0xFFFFFFAA, "/credits - Authors of the mode.");
return 1;
}
return 0;
}
stock SetPlayerMoney(playerid, money)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, money);
return;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
if(dialogid == 1) //register
{
new name[24], check[258];
GetPlayerName(playerid, name, sizeof(name));
format(check, sizeof(check), "%s.ini", name);
dini_Create(check);
dini_Set(check,"password", inputtext);
dini_IntSet(check,"money", 0);
dini_IntSet(check,"kills", 0);
dini_IntSet(check,"deaths", 0);
dini_IntSet(check,"level", 0);
dini_IntSet(check,"admin", 0);
dini_IntSet(check,"warns", 0);
dini_IntSet(check,"skill_deagle", 0);
dini_IntSet(check,"skill_shotgun", 0);
dini_IntSet(check,"skill_spas", 0);
dini_IntSet(check,"skill_mp5", 0);
dini_IntSet(check,"skill_ak", 0);
dini_IntSet(check,"skill_m4", 0);
dini_IntSet(check,"skill_sniper", 0);
dini_IntSet(check,"SkillPoints", 0);
SendClientMessage(playerid, 0xFFFFFFAA, "Account registered! You logged in automatically!");
isLogged[playerid] = 1;
return 1;
}
if(dialogid == 2) //login
{
new name[24], check[258];
GetPlayerName(playerid, name, sizeof(name));
format(check, sizeof(check), "%s.ini", name);
if(dini_Exists(check))
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Log in your account", "Bad password!\nType your password below:", "Login", "Exit");
}
else
{
if(strcmp(inputtext, dini_Get(check, "password"), false) == 0)
{
isLogged[playerid] = 1;
SCM(playerid, 0xFFFFFFAA, "You succesfully logged in!");
SetPlayerMoney(playerid, dini_Int(check, "money"));
SetPlayerScore(playerid, dini_Int(check, "kills"));
Kills[playerid] = dini_Int(check, "kills");
Deaths[playerid] = dini_Int(check, "deaths");
Level[playerid] = dini_Int(check, "level");
Admin[playerid] = dini_Int(check, "admin");
Warns[playerid] = dini_Int(check, "warns");
SkillPoints[playerid] = dini_Int(check, "SkillPoints");
Deagle[playerid] = dini_Int(check,"skill_deagle");
Shotgun[playerid] = dini_Int(check,"skill_shotgun");
Spas[playerid] = dini_Int(check,"skill_spas");
MP5[playerid] = dini_Int(check,"skill_mp5");
Ak47[playerid] = dini_Int(check,"skill_ak");
M4[playerid] = dini_Int(check,"skill_m4");
Sniper[playerid] = dini_Int(check,"skill_sniper");
}
else ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Log in your account", "Bad password!\nType your password below:", "Войти", "Выйти");
}
}
else
{
SCM(playerid, 0xFF0000AA, "FATAL ERROR: UNKNOWN ERROR 1");
Kick(playerid);
}
return 1;
}
}
else
{
if(dialogid == 1) //register
{
Kick(playerid);
}
if(dialogid == 2)
{
Kick(playerid);
}
if(dialogid == 3)
/// WARNING! I SCRAPPED THE SKILL SYSTEM. YOU CAN ACTIVATE IT BY REMOVING THE "/^ ^/"
if(dialogid == 4) //Deagle edit
{
if(Deagle[playerid] < strval(inputtext))
{
SCM(playerid, 0xFF0000AA, "You dont have that amount of skill points!");
}
else
{
Deagle[playerid] = Deagle[playerid]-strval(inputtext);
SkillPoints[playerid] = SkillPoints[playerid]+strval(inputtext);
SCM(playerid, 0xFFFFFFAA, "Skill's changed!");
}
}
if(dialogid == 5) //Shotgun edit
{
if(Shotgun[playerid] < strval(inputtext))
{
SCM(playerid, 0xFF0000AA, "You dont have that amount of skill points!");
}
else
{
Shotgun[playerid] = Shotgun[playerid]-strval(inputtext);
SkillPoints[playerid] = SkillPoints[playerid]+strval(inputtext);
SCM(playerid, 0xFFFFFFAA, "Skill's changed!");
}
}
if(dialogid == 6) //Spas edit
{
if(Spas[playerid] < strval(inputtext))
{
SCM(playerid, 0xFF0000AA, "You dont have that amount of skill points!");
}
else
{
Spas[playerid] = Spas[playerid]-strval(inputtext);
SkillPoints[playerid] = SkillPoints[playerid]+strval(inputtext);
SCM(playerid, 0xFFFFFFAA, "Skill's changed!");
}
}
if(dialogid == 7) //mp5 edit
{
if(MP5[playerid] < strval(inputtext))
{
SCM(playerid, 0xFF0000AA, "You dont have that amount of skill points!");
}
else
{
MP5[playerid] = MP5[playerid]-strval(inputtext);
SkillPoints[playerid] = SkillPoints[playerid]+strval(inputtext);
SCM(playerid, 0xFFFFFFAA, "Skill's changed!");
}
}
if(dialogid == 8) //ak47 edit
{
if(Ak47[playerid] < strval(inputtext))
{
SCM(playerid, 0xFF0000AA, "You dont have that amount of skill points!");
}
else
{
Ak47[playerid] = Ak47[playerid]-strval(inputtext);
SkillPoints[playerid] = SkillPoints[playerid]+strval(inputtext);
SCM(playerid, 0xFFFFFFAA, "Skill's changed!");
}
}
if(dialogid == 9) //m4 edit
{
if(M4[playerid] < strval(inputtext))
{
SCM(playerid, 0xFF0000AA, "You dont have that amount of skill points!");
}
else
{
M4[playerid] = M4[playerid]-strval(inputtext);
SkillPoints[playerid] = SkillPoints[playerid]+strval(inputtext);
SCM(playerid, 0xFFFFFFAA, "Skill's changed!");
}
}
if(dialogid == 10) //Sniper edit
{
if(Sniper[playerid] < strval(inputtext))
{
SCM(playerid, 0xFFFFFFAA, "You dont have that amount of skill points!");
}
else
{
Sniper[playerid] = Sniper[playerid]-strval(inputtext);
SkillPoints[playerid] = SkillPoints[playerid]+strval(inputtext);
SCM(playerid, 0xFFFFFFAA, "Skill's changed!");
}
}
}
return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate==PLAYER_STATE_ONFOOT)
{
StopPlayerHoldingObject(playerid);
OldWeapon[playerid]=0;
HoldingWeapon[playerid]=0;
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(GetPlayerState(playerid)==PLAYER_STATE_ONFOOT)
{
new weaponid=GetPlayerWeapon(playerid),oldweapontype=GetWeaponType(OldWeapon[playerid]);
new weapontype=GetWeaponType(weaponid);
if(HoldingWeapon[playerid]==weaponid)
StopPlayerHoldingObject(playerid);
if(OldWeapon[playerid]!=weaponid)
{
new modelid=GetWeaponModel(OldWeapon[playerid]);
if(modelid!=0 && oldweapontype!=WEAPON_TYPE_NONE && oldweapontype!=weapontype)
{
HoldingWeapon[playerid]=OldWeapon[playerid];
switch(oldweapontype)
{
case WEAPON_TYPE_LIGHT:
SetPlayerHoldingObject(playerid, modelid, 8,0.0,-0.1,0.15, -100.0, 0.0, 0.0);
case WEAPON_TYPE_MELEE:
SetPlayerHoldingObject(playerid, modelid, 7,0.0,0.0,-0.18, 100.0, 45.0, 0.0);
case WEAPON_TYPE_HEAVY:
SetPlayerHoldingObject(playerid, modelid, 1, 0.2,-0.125,-0.1,0.0,25.0,180.0);
}
}
}
if(oldweapontype!=weapontype)
OldWeapon[playerid]=weaponid;
}
return 1;
}
//------------------------------------------------------------------------------------------------------
GetWeaponType(weaponid)
{
switch(weaponid)
{
case 22,23,24,26,28,32:
return WEAPON_TYPE_LIGHT;
case 3,4,16,17,18,39,10,11,12,13,14,40,41:
return WEAPON_TYPE_MELEE;
case 2,5,6,7,8,9,25,27,29,30,31,33,34,35,36,37,38:
return WEAPON_TYPE_HEAVY;
}
return WEAPON_TYPE_NONE;
}
stock GetWeaponModel(weaponid)
{
switch(weaponid)
{
case 1:
return 331;
case 2..8:
return weaponid+331;
case 9:
return 341;
case 10..15:
return weaponid+311;
case 16..18:
return weaponid+326;
case 22..29:
return weaponid+324;
case 30,31:
return weaponid+325;
case 32:
return 372;
case 33..45:
return weaponid+324;
case 46:
return 371;
}
return 0;
}
stock GetWeaponNameEx(id, name[], len) return format(name,len, "%s", GunNames[id]);
stock RemovePlayerWeapon(playerid, weaponid);
public RemovePlayerWeapon(playerid, weaponid)
{ // Not mine :3
new plyWeapons[12] = 0;
new plyAmmo[12] = 0;
for(new sslot = 0; sslot != 12; sslot++)
{
new wep, ammo;
GetPlayerWeaponData(playerid, sslot, wep, ammo);
if(wep != weaponid && ammo != 0) GetPlayerWeaponData(playerid, sslot, plyWeapons[sslot], plyAmmo[sslot]);
}
ResetPlayerWeapons(playerid);
for(new sslot = 0; sslot != 12; sslot++)
{
if(plyAmmo[sslot] != 0) GivePlayerWeapon(playerid, plyWeapons[sslot], plyAmmo[sslot]);
}
return 1;
}
public purgotary(playerid)
{
Purgotary[playerid] = 0;
SetPlayerDrunkLevel(playerid, 0);
SpawnPlayer(playerid);
SetCameraBehindPlayer(playerid);
TextDrawHideForPlayer(playerid, Textdraw);
TogglePlayerControllable(playerid, 1);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == LSPD) SetPlayerColor(playerid, 0x0000FFAA);
else if(gTeam[playerid] == EMS) SetPlayerColor(playerid, 0xFF0000AA);
SetPlayerHealth(playerid, 99999);
SetTimerEx("AntiSpawnKill", 3000, 0, "i%", playerid);
if(Purgotary[playerid] == 1)
{
SetPlayerCameraPos(playerid, -833.5241,-1358.8575,86.9054);
SetPlayerCameraLookAt(playerid, -833.5241,-1358.8575,0);
SetPlayerDrunkLevel (playerid, 100000);
SetPlayerPos(playerid, 1047.5898,2921.8098,43.0475);
TextDrawShowForPlayer(playerid, Text:Textdraw);
SetTimerEx("purgotary", 10000, false, "i", playerid);
TogglePlayerControllable(playerid, 0);
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[killerid] == gTeam[playerid])
{
SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(killerid, name, sizeof(name));
format(string,sizeof(string),"Team killing is not allowed!",name);
SendClientMessage(killerid, 0xFFFFFFAA, string);
}
else
{
GivePlayerMoney(killerid, 1000);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
Kills[killerid]++;
Deaths[playerid]++;
}
SendDeathMessage(killerid, playerid, reason);
Purgotary[playerid] = 1;
return 1;
}
Код:
C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(224) : error 017: undefined symbol "i" C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(227) : error 017: undefined symbol "levl" C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(227) : error 017: undefined symbol "i" C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(227) : error 029: invalid expression, assumed zero C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(227) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.