02.01.2011, 23:54
Need help with this pawn it has errors this is the register
and here the errors
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(17) : error 010: invalid function or declaration
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(1 : error 025: function heading differs from prototype
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(62) : error 017: undefined symbol "COLOR_GREEN"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(67) : error 017: undefined symbol "COLOR_GREEN"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(120) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(120) : error 017: undefined symbol "dcmd_register"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(121) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(125) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(125) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(126) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(12 : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(129) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(134) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(135) : error 017: undefined symbol "COLOR_YELLOW"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(137) : error 017: undefined symbol "COLOR_YELLOW"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(140) : warning 225: unreachable code
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(140) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(140) : error 017: undefined symbol "dcmd_login"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(141) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(146) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(146) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(147) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(14 : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(151) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(154) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(164) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(164) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(165) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(165) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(16 : warning 225: unreachable code
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(16 : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(305) : warning 203: symbol is never used: "ret_memcpy"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(305) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
22 Errors.
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <dini>
#include <dudb>
new logged[MAX_PLAYERS];
enum pInfo
{
AdminLevel,
cash,
score,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
dcmd(register, 8, cmdtext);
dcmd(login, 5, cmdtext);
#if defined FILTERSCRIPT
#else
main()
{
print("\n----------------------------------");
print(" Mike's script");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("V3.C ");
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)
{
new name[MAX_PLAYER_NAME];
new file[128];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/Users/%s.ini",name);
if(!fexist(file))
{
SendClientMessage(playerid, COLOR_GREEN, "OMGWTFBBQ You arent registered! type /register to save your stats!");
logged[playerid] = 0;
}
if(fexist(file))
{
SendClientMessage(playerid, COLOR_GREEN, "hot damn sexy! You are registered! type /login [pass]!!");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/Users/%s.ini",name);
if(dini_Exists(file))
{
dini_IntSet(file, "score", PlayerInfo[playerid][score]);
dini_IntSet(file, "money", PlayerInfo[playerid][cash]);
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel]);
}
logged[playerid] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
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[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
dcmd_register(playerid, params[])
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Users\\%s.ini", pname);
if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: /register [password]");
if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are already registered!");
dini_Create(file);
dini_IntSet(file, "hashPW", udb_hash(params));
dini_Set(file, "password", params);
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
dini_IntSet(file, "score", PlayerInfo[playerid][score] = 0);
dini_IntSet(file, "money", PlayerInfo[playerid][cash] = 500);
new string[128];
format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s", pname, params);
SendClientMessage(playerid, COLOR_YELLOW, string);
logged[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "[SYSTEM]: You have been automatically logged in!");
return 1;}
dcmd_login(playerid, params[])
{
new file[128];
new string[MAX_STRING], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Users\\%s.ini", pname);
if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: /login [password]");
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are not registered!");
if(logged[playerid]) return SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: You are already logged in!");
new tmp;
tmp = dini_Int(file, "hashPW");
if(udb_hash(params) != tmp)
{
format(string, 256, "You specified the wrong password for %s!", pname);
SendClientMessage(playerid, COLOR_RED, string);
}
else
{
logged[playerid] = 1;
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
SetPlayerScore(playerid, PlayerInfo[playerid][score]);
new lebel = PlayerInfo[playerid][AdminLevel];
GivePlayerMoney(playerid, dini_Int(file, "money")-GetPlayerMoney(playerid));
format(string, 256, "[SYSTEM]: Successfully logged in! (level: %d)!", lebel);
SendClientMessage(playerid,COLOR_RED, string);
printf("%s (%i) logged in with password %s", pname, playerid, params);
}
return 1;}
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\Charles\Desktop\Server\gamemodes\Airline. pwn(17) : error 010: invalid function or declaration
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(1 : error 025: function heading differs from prototype
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(62) : error 017: undefined symbol "COLOR_GREEN"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(67) : error 017: undefined symbol "COLOR_GREEN"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(120) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(120) : error 017: undefined symbol "dcmd_register"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(121) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(125) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(125) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(126) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(12 : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(129) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(134) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(135) : error 017: undefined symbol "COLOR_YELLOW"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(137) : error 017: undefined symbol "COLOR_YELLOW"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(140) : warning 225: unreachable code
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(140) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(140) : error 017: undefined symbol "dcmd_login"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(141) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(146) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(146) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(147) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(14 : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(151) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(154) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(164) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(164) : error 017: undefined symbol "COLOR_RED"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(165) : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(165) : error 017: undefined symbol "params"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(16 : warning 225: unreachable code
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(16 : warning 217: loose indentation
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(305) : warning 203: symbol is never used: "ret_memcpy"
C:\Users\Charles\Desktop\Server\gamemodes\Airline. pwn(305) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
22 Errors.