Reserved car - HELP asap
#1

Okay i got this reserved car system from this site and i get 5 errors. (I had 8, but fixed em myself)
Errors:

Desktop\NordicNasca1r.pwn(30) : warning 217: loose indentation
Desktop\NordicNasca1r.pwn(41) : error 010: invalid function or declaration
Desktop\NordicNasca1r.pwn(132) : warning 217: loose indentation
Desktop\NordicNasca1r.pwn(134) : error 017: undefined symbol "newstate"
Desktop\NordicNasca1r.pwn(152) : error 010: invalid function or declaration
Desktop\NordicNasca1r.pwn(154) : error 010: invalid function or declaration
Desktop\NordicNasca1r.pwn(159) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Heres my GM : Please, look at the numbers at the left for the GM to check the errors, numbers are BOLD :

#include <a_samp>
#include <core>
#include <float>
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define FILTERSCRIPT
#define COLOR_RED 0xAA3333AA

#include <a_samp>
#include <zcmd>

#if defined FILTERSCRIPT

new NuckFuts, isReserved[MAX_PLAYERS];
new Stoked;

#pragma unused strtok

main()
{
print("\n----------------------------------");
print(" Nordic Nascar Team\n");
print("----------------------------------\n");
}

public OnPlayerConnect(playerid)
{

new tname[MAX_PLAYER_NAME];
30 GetPlayerName(playerid, tname, sizeof(tname));
if(!strcmp(tname, "NuckFuts", true)) {
isReserved[playerid] = 1;
}
else {
isReserved[playerid] = 0;
}
return 1;
}
#endif

41 return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[256];

cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "/yadayada", true) == 0) {
return 1;
}

return 0;
}

public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,0);
TogglePlayerClock(playerid,0);
return 1;
}

public OnVehicleSpawn(vehicleid)
{
AddVehicleComponent(NuckFuts, 1036);
AddVehicleComponent(NuckFuts, 1040);
AddVehicleComponent(NuckFuts, 1034);
AddVehicleComponent(NuckFuts, 1172);
AddVehicleComponent(NuckFuts, 1149);
AddVehicleComponent(NuckFuts, 1035);
AddVehicleComponent(NuckFuts, 1146);
AddVehicleComponent(NuckFuts, 1079);
AddVehicleComponent(Stoked, 1074);
AddVehicleComponent(Stoked, 1149);
AddVehicleComponent(Stoked, 1172);
AddVehicleComponent(Stoked, 1036);
AddVehicleComponent(Stoked, 1040);
}

CMD:callmycar(playerid, params[])
{
if(isReserved[playerid] == 1) {
new Float:X,Float:Y,Float:Z, tname[MAX_PLAYER_NAME];
GetPlayerName(playerid, tname, sizeof(tname));
if(strfind(tname, "NuckFuts", true) != -1) {
GetPlayerPos(playerid, X,Y,Z);
SetVehiclePos(NuckFuts, X+3, Y+3, Z);
}
}
else {
if(isReserved[playerid] == 1) {
new Float:X,Float:Y,Float:Z, tname[MAX_PLAYER_NAME];
GetPlayerName(playerid, tname, sizeof(tname));
if(strfind(tname, "Stoked", true) != -1) {
GetPlayerPos(playerid, X,Y,Z);
SetVehiclePos(Stoked, X+3, Y+3, Z);
}
}
else {
SendClientMessage(playerid, COLOR_RED, "Your name isn't on the reserved list.");
}
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}

public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

new PlayerName[24];
132 GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

134 if(newstate == PLAYER_STATE_DRIVER) {
new Vehicle = GetPlayerVehicleID(playerid);
if(Vehicle == NuckFuts) {
if(strcmp(PlayerName,"NuckFuts",true)) {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAA3333AA, "This car is reserved for: NuckFuts");
}
}
if(Vehicle == Stoked) {
if(strcmp(PlayerName,"Stoked",true)) {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAA3333AA, "This car is reserved for: Stoked");
}
}
}
return 1;
}

152 if (PRESSED(KEY_FIRE))
{
154 if (IsPlayerInAnyVehicle(playerid))
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
}
159 return 1;
}

public OnFilterScriptInit()
{
NuckFuts = AddStaticVehicle(562,1485.8141,-693.2712,94.4098,228.1685,0,0);
Stoked = AddStaticVehicle(562,1460.5796,-635.6774,95.5308,179.8477,1,1);
AddVehicleComponent(NuckFuts, 1036);
AddVehicleComponent(NuckFuts, 1040);
AddVehicleComponent(NuckFuts, 1034);
AddVehicleComponent(NuckFuts, 1172);
AddVehicleComponent(NuckFuts, 1149);
AddVehicleComponent(NuckFuts, 1035);
AddVehicleComponent(NuckFuts, 1146);
AddVehicleComponent(NuckFuts, 1079);
AddVehicleComponent(Stoked, 1074);
AddVehicleComponent(Stoked, 1149);
AddVehicleComponent(Stoked, 1172);
AddVehicleComponent(Stoked, 1036);
AddVehicleComponent(Stoked, 1040);
return 1;
}

public OnGameModeInit()
{
SetGameModeText("Nordic Nascar");
ShowPlayerMarkers(1);
ShowNameTags(1);
AllowAdminTeleport(1);

AddPlayerClass(180,1958.3783,1343.1572,15.3746,270 .1425,0,0,0,0,-1,-1);
AddPlayerClass(230,1958.3783,1343.1572,15.3746,270 .1425,0,0,0,0,-1,-1);
AddPlayerClass(169,1958.3783,1343.1572,15.3746,270 .1425,0,0,0,0,-1,-1);
AddPlayerClass(115,1958.3783,1343.1572,15.3746,270 .1425,0,0,0,0,-1,-1);
AddPlayerClass(108,1958.3783,1343.1572,15.3746,270 .1425,0,0,0,0,-1,-1);
AddPlayerClass(102,1958.3783,1343.1572,15.3746,270 .1425,0,0,0,0,-1,-1);
AddPlayerClass(93,1958.3783,1343.1572,15.3746,270. 1425,0,0,0,0,-1,-1);
AddPlayerClass(86,1958.3783,1343.1572,15.3746,270. 1425,0,0,0,0,-1,-1);
AddPlayerClass(25,1958.3783,1343.1572,15.3746,270. 1425,0,0,0,0,-1,-1);
AddPlayerClass(23,1958.3783,1343.1572,15.3746,270. 1425,0,0,0,0,-1,-1);
AddPlayerClass(22,1958.3783,1343.1572,15.3746,270. 1425,0,0,0,0,-1,-1);
AddPlayerClass(21,1958.3783,1343.1572,15.3746,270. 1425,0,0,0,0,-1,-1);
AddPlayerClass(18,1958.3783,1343.1572,15.3746,270. 1425,0,0,0,0,-1,-1);
AddPlayerClass(12,1958.3783,1343.1572,15.3746,270. 1425,0,0,0,0,-1,-1);
AddPlayerClass(2,1958.3783,1343.1572,15.3746,270.1 425,0,0,0,0,-1,-1);
AddPlayerClass(265,1958.3783,1343.1572,15.3746,270 .1425,0,0,0,0,-1,-1);
AddStaticVehicle(502,-1954.2421,270.4366,40.9378,219.6907,36,8; //
AddStaticVehicle(593,1641.6836,1534.0157,11.2394,3 59.5808,58,; //
AddStaticVehicle(502,1680.9374,1642.4747,10.7125,1 83.5951,51,75); //
AddStaticVehicle(494,1684.8931,1642.6722,10.5943,1 83.3893,42,33); //
AddStaticVehicle(494,2040.2238,1341.4673,10.4469,0 .1761,75,79); //
AddStaticVehicle(494,2040.1786,1347.3323,10.4467,3 59.9033,36,117); //
AddStaticVehicle(562,2023.2207,1334.2344,9.9924,26 9.9702,35,1); //
AddStaticVehicle(562,2022.6525,1351.6447,9.9262,27 0.2971,17,1); //
AddStaticVehicle(502,2038.6685,1372.9619,10.5740,3 59.9970,36,8; //
AddStaticVehicle(562,2039.0295,1549.8147,10.2786,1 79.5966,116,1); //
AddStaticVehicle(566,2150.9390,1483.1517,10.6041,0 .1396,30,; //
AddStaticVehicle(506,2139.2742,1408.6450,10.4804,3 59.3202,52,52); //
AddPlayerClass(0,-1896.6964,242.8549,41.0469,16.7044,0,0,0,0,0,0); //
AddStaticVehicle(502,-1895.2896,273.9190,40.9410,181.9889,51,75); //
AddStaticVehicle(502,-1898.9841,273.7648,40.9327,180.5829,58,67); //
AddStaticVehicle(562,1464.5601,-902.4739,54.4426,178.6111,35,1); //
AddStaticVehicle(562,1368.7902,-846.8735,43.6713,211.6595,17,1); //
AddStaticVehicle(541,2075.0532,1412.7218,10.3627,1 80.2748,2,1); //

SetGameModeText("The Nordic Nascar Team");
ShowPlayerMarkers(1);
ShowNameTags(1);
AllowAdminTeleport(1);

return 1;
}

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Reply
#2

OH GAAAD,

USE BBCODE!!!

Код:
[ pawn ]
[ /pawn ]
Without spaces
Reply
#3

Upload to Pastebin.
Reply
#4

Quote:
Originally Posted by henry jiggy
Посмотреть сообщение
OH GAAAD,

USE BBCODE!!!

Код:
[ pawn ]
[ /pawn ]
Without spaces
Huh ? Im new in this ind. lolz
Reply
#5

Why do you use onfilterscriptinit and ongamemodeinit but define it a filterscript then end the else define in the middle of onplayerconnect?
Reply
#6

Indent properly. Look at other people's scripts.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)