13.05.2014, 11:57
Hello,
I'm working on a FS with Skill system. If you have kill X or + players, he give at spawn one or two or three more weapons...
this is my pawn code but if i compile do thir error...:
help me pls
I'm working on a FS with Skill system. If you have kill X or + players, he give at spawn one or two or three more weapons...
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <a_samp> // This includes a_samp from pawno/include/
#include <Dini> // This include is use for saving data's
#include <Dutils> // This include is used for some important function
#include <Dudb> // This include is used for hashing password
#define COLOR_RED 0xFF0000FF
#define COLOR_BLUE 0x0004FFFF
#define COLOR_GREEN 0x00FF55FF
#define COLOR_YELLOW 0xEAFF00FF
#define COLOR_ORANGE 0xFFB300FF
#define COLOR_BLACK 0x000000FF
#define COLOR_WHITE 0xFFFFFFFF
#define savefolder "/skills/%s.ini" // This defines the file name and folder
#pragma unused ret_memcpy // This avoid the ret_memcpy warning
new Killz[MAX_PLAYERS]; // We have used this variable because to save the kills of the player
new Skillz_Weap[MAX_PLAYERS]; // Same on here
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
new pname[128]; // This get's the length of the player name
new file[128]; // This get's the lenght of the file
GetPlayerName(playerid, pname, sizeof(pname)); // This get's the player name with the lenght of the player name
format(file, sizeof(file), savefolder,pname); // This describe's where to save and how to save it
if(!dini_Exists(file)) { // If the file exist
dini_Create(file); // Create the file
dini_IntSet(file, "Kills", Killz[playerid]); // Set's "Kills"
dini_IntSet(file, "Skill_Weap", Skillz_Weap[playerid]); // Set's "Skill_Weap"
// and at last this set's the value which were on the file
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[128]; // The name length
new file[128]; // The file length
GetPlayerName(playerid, pname, sizeof(pname)); // This get's the player name with the name length
format(file, sizeof(file), savefolder,pname); // Formatting file
if(!dini_Exists(file)) { // If the file exist
}
else
{ // if not
dini_IntSet(file, "Kills", Killz[playerid]); // This get the kills
dini_IntSet(file, "Skill_Weap", Skillz_Weap[playerid]); // This get the Skill_Weap
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(Killz[MAX_PLAYERS]>=10)
{
Skillz_Weap[playerid] ++;
GivePlayerWeapon(playerid,28,500);// The death value will be increased
if(Killz[MAX_PLAYERS]>=20)
{
Skillz_Weap[playerid] ++; // The death value will be increased
if(Killz[MAX_PLAYERS]>=30)
{
Skillz_Weap[playerid] ++; // The death value will be increased
}
}
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
Killz[killerid] ++; // The killer value will be increased
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)
{
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;
}
Код:
C:\Users\Vincenzo\Desktop\M3 SAMP\filterscripts\Skills_1.0.pwn(90) : error 032: array index out of bounds (variable "Killz") C:\Users\Vincenzo\Desktop\M3 SAMP\filterscripts\Skills_1.0.pwn(94) : error 032: array index out of bounds (variable "Killz") C:\Users\Vincenzo\Desktop\M3 SAMP\filterscripts\Skills_1.0.pwn(97) : error 032: array index out of bounds (variable "Killz") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.


thx 