Hallo allemaal, nadat ik een PAWNO tutorial op de SA:MP wiki gevonden had wilde ik wel eens een TDM maken. Dus ik ging vol goede hoop aan de slag. Maar, hoe kan het ook anders, bij het compilen kreeg ik een aantal errors. Ik hoop dat jullie weten wat er aan de hand is!
Script:
#include <a_samp>
#include <core>
#include <float>
#include <datagram>
#include <file>
#include <string>
#include <time>
#define TEAM_ORANGE
#define TEAM_YELLOW
#define TEAM_ORANGE_COLOR 0xFF9900AA //orange color
#define TEAM_YELLOW_COLOR 0xFFFF00AA //yellow color
new gTeam[MAX_PLAYERS];
main()
{
print("\n----------------------------------");
print(" This is a blank GameModeScript");
print("----------------------------------\n");
}
public OnGameModeInit()
{
print("GameModeInit()");
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(57, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
}
public SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0)
{
gTeam[playerid] = TEAM_ORANGE; // defines which team should be assigned
}
else
{
gTeam[playerid] = TEAM_YELLOW; //defines which team should be assigned
}
}
public SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_ORANGE)
{
SetPlayerColor(playerid, TEAM_ORANGE_COLOR);
}
else if (gTeam[playerid] == TEAM_YELLOW)
{
SetPlayerColor(playerid, TEAM_YELLOW_COLOR);
}
}
public OnGameModeExit()
{
print("GameModeExit()");
return 1;
}
public OnPlayerConnect(playerid)
{
printf("OnPlayerConnect(%d)", playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
printf("OnPlayerDisconnect(%d)", playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
printf("OnPlayerSpawn(%d)", playerid);
SetPlayerToTeamColor(playerid);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
printf("OnPlayerDeath(%d, %d, %d)", playerid, killerid, reason);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
printf("OnVehicleSpawn(%d)", vehicleid);
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
printf("OnVehicleDeath(%d, %d)", vehicleid, killerid);
return 1;
}
public OnPlayerText(playerid)
{
printf("OnPlayerText(%d)", playerid);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/mycommand", true)==0)
{
/* Do something here */
return 1;
}
return 0;
}
public OnPlayerInfoChange(playerid)
{
printf("OnPlayerInfoChange(%d)");
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
printf("OnPlayerEnterVehicle(%d, %d, %d)", playerid, vehicleid, ispassenger);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
printf("OnPlayerExitVehicle(%d, %d)", playerid, vehicleid);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
printf("OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
printf("OnPlayerEnterCheckpoint(%d)", playerid);
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
printf("OnPlayerLeaveCheckpoint(%d)", playerid);
return 1;
}
Error:
C:\Documents and Settings\-Roy-\Bureaublad\server\gamemodes\commandtestfile.pwn(44) : error 029: invalid expression, assumed zero
C:\Documents and Settings\-Roy-\Bureaublad\server\gamemodes\commandtestfile.pwn(48) : error 029: invalid expression, assumed zero
C:\Documents and Settings\-Roy-\Bureaublad\server\gamemodes\commandtestfile.pwn(54) : error 029: invalid expression, assumed zero
C:\Documents and Settings\-Roy-\Bureaublad\server\gamemodes\commandtestfile.pwn(58) : error 029: invalid expression, assumed zero
Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase
4 Errors.
Hallo allemaal, nadat ik een PAWNO tutorial op de SA:MP wiki gevonden had wilde ik wel eens een TDM maken. Dus ik ging vol goede hoop aan de slag. Maar, hoe kan het ook anders, bij het compilen kreeg ik een aantal errors. Ik hoop dat jullie weten wat er aan de hand is!
Script:
#include <a_samp> #include <core> #include <float> #include <datagram> #include <file> #include <string> #include <time> #define TEAM_ORANGE #define TEAM_YELLOW #define TEAM_ORANGE_COLOR 0xFF9900AA //orange color #define TEAM_YELLOW_COLOR 0xFFFF00AA //yellow color new gTeam[MAX_PLAYERS]; main() { print("\n----------------------------------"); print(" This is a blank GameModeScript"); print("----------------------------------\n"); } public OnGameModeInit() { print("GameModeInit()"); SetGameModeText("Blank Script"); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); AddPlayerClass(57, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); } public SetPlayerTeamFromClass(playerid, classid) { if (classid == 0) { gTeam[playerid] = TEAM_ORANGE; // defines which team should be assigned } else { gTeam[playerid] = TEAM_YELLOW; //defines which team should be assigned } } public SetPlayerToTeamColor(playerid) { if (gTeam[playerid] == TEAM_ORANGE) { SetPlayerColor(playerid, TEAM_ORANGE_COLOR); } else if (gTeam[playerid] == TEAM_YELLOW) { SetPlayerColor(playerid, TEAM_YELLOW_COLOR); } } public OnGameModeExit() { print("GameModeExit()"); return 1; } public OnPlayerConnect(playerid) { printf("OnPlayerConnect(%d)", playerid); return 1; } public OnPlayerDisconnect(playerid) { printf("OnPlayerDisconnect(%d)", playerid); return 1; } public OnPlayerSpawn(playerid) { printf("OnPlayerSpawn(%d)", playerid); SetPlayerToTeamColor(playerid); return 1; } public OnPlayerDeath(playerid, killerid, reason) { printf("OnPlayerDeath(%d, %d, %d)", playerid, killerid, reason); return 1; } public OnVehicleSpawn(vehicleid) { printf("OnVehicleSpawn(%d)", vehicleid); return 1; } public OnVehicleDeath(vehicleid, killerid) { printf("OnVehicleDeath(%d, %d)", vehicleid, killerid); return 1; } public OnPlayerText(playerid) { printf("OnPlayerText(%d)", playerid); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/mycommand", true)==0) { /* Do something here */ return 1; } return 0; } public OnPlayerInfoChange(playerid) { printf("OnPlayerInfoChange(%d)"); return 1; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { printf("OnPlayerEnterVehicle(%d, %d, %d)", playerid, vehicleid, ispassenger); return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { printf("OnPlayerExitVehicle(%d, %d)", playerid, vehicleid); return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { printf("OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate); return 1; } public OnPlayerEnterCheckpoint(playerid) { printf("OnPlayerEnterCheckpoint(%d)", playerid); return 1; } public OnPlayerLeaveCheckpoint(playerid) { printf("OnPlayerLeaveCheckpoint(%d)", playerid); return 1; }Error:
Alvast bedankt!