#include <a_samp>
new gTeam[MAX_PLAYERS];
#define GROVE_STREET 1
#define POLICE 2
#define GROVE_STREET_COLOUR 0x00820FAA
#define POLICE_COLOUR 0x003DF5AA
#include <a_samp>
#define GROVE_STREET 1
#define POLICE 2
#define GROVE_STREET_COLOUR 0x00820FAA
#define POLICE_COLOUR 0x003DF5AA
new gTeam[MAX_PLAYERS];
public OnGameModeInit()
{
AddPlayerClass(105,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0); //Grove Street Gang Member (0)
AddPlayerClass(280,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Police Officer (1)
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColour(playerid);
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = GROVE_STREET;
}
}
SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == GROVE_STREET)
{
SetPlayerColor(playerid,GROVE_STREET_COLOUR); //Green
}
}
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = GROVE_STREET;
}
if(classid == 1)
{
gTeam[playerid] = POLICE;
}
}
SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == GROVE_STREET)
{
SetPlayerColor(playerid,GROVE_STREET_COLOUR); //Green
}
if(gTeam[playerid] == POLICE)
{
SetPlayerColor(playerid,POLICE_COLOUR); // Blue
}
}
enum TeamCars
{
GroveStreet,
Police
}
new Cars[TeamCars];
public OnGameModeInit()
{
AddPlayerClass(105,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0); //Grove Street Gang Member (0)
AddPlayerClass(280,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Police Officer (1)
Cars[GroveStreet] = CreateVehicle(492,2484.3054,-1655.0886,13.1036,90.8565,44,16,900); //Greenwood
Cars[Police] = CreateVehicle(596,1536.0603,-1676.5302,13.1054,0.6847,-1,-1,900); //LSPD Cruiser
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Cars[GroveStreet] )
{
if(gTeam[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
return 1;
}
}
if(CarCheck == Cars[Police] )
{
if(gTeam[playerid] != 2)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
return 1;
}
}
return 1;
}
return 1;
}
#define COLOR_RED 0xFF0000AA
C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(9) : error 001: expected token: "-identifier-", but found "-integer value-" C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(20) : warning 213: tag mismatch C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(20) : error 032: array index out of bounds (variable "Cars") C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(21) : warning 213: tag mismatch C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(21) : error 032: array index out of bounds (variable "Cars") C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(22) : warning 213: tag mismatch C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(22) : error 032: array index out of bounds (variable "Cars") C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(23) : warning 213: tag mismatch C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(23) : error 032: array index out of bounds (variable "Cars") C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(60) : warning 213: tag mismatch C:\Users\Desertsoulz_2\Desktop\SA-MP\GTA San Andreas\SAMP\gamemodes\ADMINS.pwn(60) : error 032: array index out of bounds (variable "Cars") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase |
#include <a_samp> #define ADMINS 99 #define ADMINS_COLOR 0xFF00FFAA //Purple #define COLOR_RED 0xFF0000AA //RED enum TeamCars { ADMINS } new gTeam[MAX_PLAYERS]; new Cars[TeamCars]; public OnGameModeInit() { AddPlayerClass(163,2127.6602,2377.6648,10.8203,182.7401,0,0,0,0,0,0); AddPlayerClass(164,2127.6602,2377.6648,10.8203,182.7401,0,0,0,0,0,0); Cars[ADMINS] = CreateVehicle(522,2091.4963,2361.1116,10.8058,183.7787,85,0,1000); // Cars[ADMINS] = CreateVehicle(522,2093.6804,2360.7153,10.8131,180.7032,85,0,1000); // Cars[ADMINS] = CreateVehicle(522,2095.8301,2361.1843,10.8129,177.7382,85,0,1000); // Cars[ADMINS] = CreateVehicle(522,2098.3806,2361.2388,10.8129,177.9737,85,0,1000); // return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); return 1; } public OnPlayerSpawn(playerid) { SetPlayerToTeamColour(playerid); return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == 99) { gTeam[playerid] = ADMINS; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == ADMINS) { SetPlayerColor(playerid,ADMINS_COLOR); //Purple } } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new CarCheck = GetPlayerVehicleID(playerid); if(CarCheck == Cars[ADMINS] ) { if(gTeam[playerid] != 99) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You can't drive this car!"); return 1; } } return 1; } return 1; }
Please respond, I tried to make an Admin team for CnR
Here's the script. Код:
#include <a_samp> #define ADMINS 99 #define ADMINS_COLOR 0xFF00FFAA //Purple #define COLOR_RED 0xFF0000AA //RED enum TeamCars { ADMINS } new gTeam[MAX_PLAYERS]; new Cars[TeamCars]; public OnGameModeInit() { AddPlayerClass(163,2127.6602,2377.6648,10.8203,182.7401,0,0,0,0,0,0); AddPlayerClass(164,2127.6602,2377.6648,10.8203,182.7401,0,0,0,0,0,0); Cars[ADMINS] = CreateVehicle(522,2091.4963,2361.1116,10.8058,183.7787,85,0,1000); // Cars[ADMINS] = CreateVehicle(522,2093.6804,2360.7153,10.8131,180.7032,85,0,1000); // Cars[ADMINS] = CreateVehicle(522,2095.8301,2361.1843,10.8129,177.7382,85,0,1000); // Cars[ADMINS] = CreateVehicle(522,2098.3806,2361.2388,10.8129,177.9737,85,0,1000); // return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); return 1; } public OnPlayerSpawn(playerid) { SetPlayerToTeamColour(playerid); return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == 99) { gTeam[playerid] = ADMINS; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == ADMINS) { SetPlayerColor(playerid,ADMINS_COLOR); //Purple } } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new CarCheck = GetPlayerVehicleID(playerid); if(CarCheck == Cars[ADMINS] ) { if(gTeam[playerid] != 99) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You can't drive this car!"); return 1; } } return 1; } return 1; } |
enum TeamCars { ADMIN }
#include <a_samp> #define ADMINS 99 #define ADMINS_COLOR 0xFF00FFAA //Purple #define COLOR_RED 0xFF0000AA //RED enum TeamCars { ADMIN } new gTeam[MAX_PLAYERS]; new Cars[TeamCars]; public OnGameModeInit() { AddPlayerClass(163,2127.6602,2377.6648,10.8203,182.7401,0,0,0,0,0,0); AddPlayerClass(164,2127.6602,2377.6648,10.8203,182.7401,0,0,0,0,0,0); Cars[ADMIN] = CreateVehicle(522,2091.4963,2361.1116,10.8058,183.7787,85,0,1000); // Cars[ADMIN] = CreateVehicle(522,2093.6804,2360.7153,10.8131,180.7032,85,0,1000); // Cars[ADMIN] = CreateVehicle(522,2095.8301,2361.1843,10.8129,177.7382,85,0,1000); // Cars[ADMIN] = CreateVehicle(522,2098.3806,2361.2388,10.8129,177.9737,85,0,1000); // return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); return 1; } public OnPlayerSpawn(playerid) { SetPlayerToTeamColour(playerid); return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == 99) { gTeam[playerid] = ADMINS; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == ADMINS) { SetPlayerColor(playerid,ADMINS_COLOR); //Purple } } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new CarCheck = GetPlayerVehicleID(playerid); if(CarCheck == Cars[ADMIN] ) { if(gTeam[playerid] != 99) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You can't drive this car!"); return 1; } } return 1; } return 1; }
Try using
Код:
enum TeamCars { ADMIN } Here's the full code with those changed: Код:
#include <a_samp> #define ADMINS 99 #define ADMINS_COLOR 0xFF00FFAA //Purple #define COLOR_RED 0xFF0000AA //RED enum TeamCars { ADMIN } new gTeam[MAX_PLAYERS]; new Cars[TeamCars]; public OnGameModeInit() { AddPlayerClass(163,2127.6602,2377.6648,10.8203,182.7401,0,0,0,0,0,0); AddPlayerClass(164,2127.6602,2377.6648,10.8203,182.7401,0,0,0,0,0,0); Cars[ADMIN] = CreateVehicle(522,2091.4963,2361.1116,10.8058,183.7787,85,0,1000); // Cars[ADMIN] = CreateVehicle(522,2093.6804,2360.7153,10.8131,180.7032,85,0,1000); // Cars[ADMIN] = CreateVehicle(522,2095.8301,2361.1843,10.8129,177.7382,85,0,1000); // Cars[ADMIN] = CreateVehicle(522,2098.3806,2361.2388,10.8129,177.9737,85,0,1000); // return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); return 1; } public OnPlayerSpawn(playerid) { SetPlayerToTeamColour(playerid); return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == 99) { gTeam[playerid] = ADMINS; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == ADMINS) { SetPlayerColor(playerid,ADMINS_COLOR); //Purple } } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new CarCheck = GetPlayerVehicleID(playerid); if(CarCheck == Cars[ADMIN] ) { if(gTeam[playerid] != 99) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You can't drive this car!"); return 1; } } return 1; } return 1; } |
C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(14) : error 001: expected token: "-identifier-", but found "-integer value-" C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(47) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(47) : error 032: array index out of bounds (variable "Cars") C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(48) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(48) : error 032: array index out of bounds (variable "Cars") C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(49) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(49) : error 032: array index out of bounds (variable "Cars") C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(50) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(50) : error 032: array index out of bounds (variable "Cars") C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(702) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(702) : error 032: array index out of bounds (variable "Cars") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.
#include <a_samp> #include <core> #define SPECIAL_ACTION_PISSING 68 #define MAX_INVALID_NOS_VEHICLES 29 #define DOD 1 #define DOD_COLOUR 0x00820FAA #define COLOR_RED 0xFF0000AA enum TeamCars { DOD } new Cars[TeamCars]; new gTeam[MAX_PLAYERS]; new ELEGY; new ELEGY2; new ELEGY3; new JESTER; new JESTER2; new STRATUM; new STRATUM2; new STRATUM3; new STRATUM4; new TE1; forward NitroReset(); main() { print("\n __________________________________\n"); print("\n| Drift |\n"); print("\n|__________________________________|\n"); } public OnGameModeInit() { SetGameModeText("Drift"); UsePlayerPedAnims(); SetTimer("NitroReset", 1500, 1); //Funзхes para Spawn de Members - DOD AddPlayerClass(299,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0); AddPlayerClass(104,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); Cars[DOD] = CreateVehicle(562,-2506.870117, -635.783325, 134.652481, 359.465423, -1, -1, 10000); Cars[DOD] = CreateVehicle(429,-2494.236083, -633.563049, 134.012542, 359.016265, -1, -1, 10000); Cars[DOD] = CreateVehicle(507,-2530.7561,-618.6442,132.1928,269.1777,1,1); Cars[DOD] = CreateVehicle(436,-2529.5754,-606.6457,132.1944,270.8741,1,1); return 1; } public OnGameModeExit() { return 1; } public OnPlayerUpdate(playerid) { SetPlayerScore(playerid, GetPlayerMoney(playerid)); return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); return 1; } public NitroReset() { for(new i = 0; i<MAX_PLAYERS; i++) { if(!IsPlayerInInvalidNosVehicle(i,GetPlayerVehicleID(i))) { new vehicle = GetPlayerVehicleID(i); AddVehicleComponent(vehicle, 1010); } } } IsPlayerInInvalidNosVehicle(playerid,vehicleid) { new InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] = { 581,523,462,521,463,522,461,448,468,586, 509,481,510,472,473,493,595,484,430,453, 452,446,454,590,569,537,538,570,449 }; vehicleid = GetPlayerVehicleID(playerid); if(IsPlayerInVehicle(playerid,vehicleid)) { for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++) { if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i]) { return true; } } } return false; } public OnPlayerConnect(playerid) { GivePlayerMoney(playerid, 0); new pName[30], string[128]; GetPlayerName(playerid, pName, 30); format(string, 256, "%s entrou no server.", pName); SendClientMessageToAll(0x33AA33AA,string); SendClientMessage(playerid, 0x33CCFFAA, "Se bem Vindo ao Servidor de Drift Nacional!"); SendClientMessage(playerid, 0x33CCFFAA, "[DOD] - Drift Or Die"); SendClientMessage(playerid, 0x33CCFFAA, "Escreve /cmd para aprenderes alguns comandos!"); return 1; } public OnPlayerDisconnect(playerid, reason) { new pName[30], string[128]; GetPlayerName(playerid, pName, 30); format(string, 256, "%s saiu do server.", pName); SendClientMessageToAll(0xA52A2AAA,string); return 1; } public OnPlayerSpawn(playerid) { SetPlayerHealth(playerid,9000.0); SetPlayerToTeamColour(playerid); return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = DOD; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == DOD) { SetPlayerColor(playerid,DOD_COLOUR); //Green } } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new CarCheck = GetPlayerVehicleID(playerid); if(CarCheck == Cars[DOD] ) { if(gTeam[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You Don't Belong to DOD Crew!"); return 1; } } return 1; } return 1; }
I got the same errorS!! Please somebody can help me here? ='(
Code:
C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(14) : error 001: expected token: "-identifier-", but found "-integer value-" C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(47) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(47) : error 032: array index out of bounds (variable "Cars") C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(48) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(48) : error 032: array index out of bounds (variable "Cars") C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(49) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(49) : error 032: array index out of bounds (variable "Cars") C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(50) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(50) : error 032: array index out of bounds (variable "Cars") C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(702) : warning 213: tag mismatch C:\Documents and Settings\Tiago Esteves\Ambiente de trabalho\Servidor - Teste\pawno\Driftv2.pwn(702) : error 032: array index out of bounds (variable "Cars") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors. Code:
#include <a_samp> #include <core> #define SPECIAL_ACTION_PISSING 68 #define MAX_INVALID_NOS_VEHICLES 29 #define DOD 1 #define DOD_COLOUR 0x00820FAA #define COLOR_RED 0xFF0000AA enum TeamCars { DOD } new Cars[TeamCars]; new gTeam[MAX_PLAYERS]; new ELEGY; new ELEGY2; new ELEGY3; new JESTER; new JESTER2; new STRATUM; new STRATUM2; new STRATUM3; new STRATUM4; new TE1; forward NitroReset(); main() { print("\n __________________________________\n"); print("\n| Drift |\n"); print("\n|__________________________________|\n"); } public OnGameModeInit() { SetGameModeText("Drift"); UsePlayerPedAnims(); SetTimer("NitroReset", 1500, 1); //Funзхes para Spawn de Members - DOD AddPlayerClass(299,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0); AddPlayerClass(104,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); Cars[DOD] = CreateVehicle(562,-2506.870117, -635.783325, 134.652481, 359.465423, -1, -1, 10000); Cars[DOD] = CreateVehicle(429,-2494.236083, -633.563049, 134.012542, 359.016265, -1, -1, 10000); Cars[DOD] = CreateVehicle(507,-2530.7561,-618.6442,132.1928,269.1777,1,1); Cars[DOD] = CreateVehicle(436,-2529.5754,-606.6457,132.1944,270.8741,1,1); return 1; } public OnGameModeExit() { return 1; } public OnPlayerUpdate(playerid) { SetPlayerScore(playerid, GetPlayerMoney(playerid)); return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(playerid, classid); return 1; } public NitroReset() { for(new i = 0; i<MAX_PLAYERS; i++) { if(!IsPlayerInInvalidNosVehicle(i,GetPlayerVehicleID(i))) { new vehicle = GetPlayerVehicleID(i); AddVehicleComponent(vehicle, 1010); } } } IsPlayerInInvalidNosVehicle(playerid,vehicleid) { new InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] = { 581,523,462,521,463,522,461,448,468,586, 509,481,510,472,473,493,595,484,430,453, 452,446,454,590,569,537,538,570,449 }; vehicleid = GetPlayerVehicleID(playerid); if(IsPlayerInVehicle(playerid,vehicleid)) { for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++) { if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i]) { return true; } } } return false; } public OnPlayerConnect(playerid) { GivePlayerMoney(playerid, 0); new pName[30], string[128]; GetPlayerName(playerid, pName, 30); format(string, 256, "%s entrou no server.", pName); SendClientMessageToAll(0x33AA33AA,string); SendClientMessage(playerid, 0x33CCFFAA, "Se bem Vindo ao Servidor de Drift Nacional!"); SendClientMessage(playerid, 0x33CCFFAA, "[DOD] - Drift Or Die"); SendClientMessage(playerid, 0x33CCFFAA, "Escreve /cmd para aprenderes alguns comandos!"); return 1; } public OnPlayerDisconnect(playerid, reason) { new pName[30], string[128]; GetPlayerName(playerid, pName, 30); format(string, 256, "%s saiu do server.", pName); SendClientMessageToAll(0xA52A2AAA,string); return 1; } public OnPlayerSpawn(playerid) { SetPlayerHealth(playerid,9000.0); SetPlayerToTeamColour(playerid); return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = DOD; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == DOD) { SetPlayerColor(playerid,DOD_COLOUR); //Green } } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new CarCheck = GetPlayerVehicleID(playerid); if(CarCheck == Cars[DOD] ) { if(gTeam[playerid] != 1) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You Don't Belong to DOD Crew!"); return 1; } } return 1; } return 1; } |
#include <a_samp>
#define SPECIAL_ACTION_PISSING 68
#define MAX_INVALID_NOS_VEHICLES 29
#define DOD 1
#define DOD_COLOUR 0x00820FAA
#define COLOR_RED 0xFF0000AA
new Car1,Car2,Car3,Car4;
new gTeam[MAX_PLAYERS];
//new ELEGY;
//new ELEGY2;
//new ELEGY3;
//new JESTER;
//new JESTER2;
//new STRATUM;
//new STRATUM2;
//new STRATUM3;
//new STRATUM4;
//new TE1;
forward NitroReset();
main()
{
print("\n __________________________________\n");
print("\n| Drift |\n");
print("\n|__________________________________|\n");
}
public OnGameModeInit()
{
SetGameModeText("Drift");
UsePlayerPedAnims();
SetTimer("NitroReset", 1500, 1);
//Funзхes para Spawn de Members - DOD
AddPlayerClass(299,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
AddPlayerClass(104,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0);
Car1 = AddStaticVehicleEx(562,-2506.870117, -635.783325, 134.652481, 359.465423, -1, -1, 10000);
Car2 = AddStaticVehicleEx(429,-2494.236083, -633.563049, 134.012542, 359.016265, -1, -1, 10000);
Car3 = AddStaticVehicle(507,-2530.7561,-618.6442,132.1928,269.1777,1,1);
Car4 = AddStaticVehicle(436,-2529.5754,-606.6457,132.1944,270.8741,1,1);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerUpdate(playerid)
{
SetPlayerScore(playerid, GetPlayerMoney(playerid));
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
public NitroReset()
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerInInvalidNosVehicle(i,GetPlayerVehicleID(i)))
{
new vehicle = GetPlayerVehicleID(i);
AddVehicleComponent(vehicle, 1010);
}
}
}
IsPlayerInInvalidNosVehicle(playerid,vehicleid)
{
new InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] =
{
581,523,462,521,463,522,461,448,468,586,
509,481,510,472,473,493,595,484,430,453,
452,446,454,590,569,537,538,570,449
};
vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid,vehicleid))
{
for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++)
{
if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i])
{
return true;
}
}
}
return false;
}
public OnPlayerConnect(playerid)
{
GivePlayerMoney(playerid, 0);
new pName[30], string[128];
GetPlayerName(playerid, pName, 30);
format(string, 256, "%s entrou no server.", pName);
SendClientMessageToAll(0x33AA33AA,string);
SendClientMessage(playerid, 0x33CCFFAA, "Se bem Vindo ao Servidor de Drift Nacional!");
SendClientMessage(playerid, 0x33CCFFAA, "[DOD] - Drift Or Die");
SendClientMessage(playerid, 0x33CCFFAA, "Escreve /cmd para aprenderes alguns comandos!");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pName[30], string[128];
GetPlayerName(playerid, pName, 30);
format(string, 256, "%s saiu do server.", pName);
SendClientMessageToAll(0xA52A2AAA,string);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid,9000.0);
SetPlayerToTeamColour(playerid);
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = DOD;
}
}
SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == DOD)
{
SetPlayerColor(playerid,DOD_COLOUR); //Green
}
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Car1 || Car2 || Car3 || Car4 )
{
if(gTeam[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You Don't Belong to DOD Crew!");
return 1;
}
}
return 1;
}
return 1;
}
Code:
SetPlayerTeamFromClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = GROVE_STREET; } if(classid == 1) { gTeam[playerid] = POLICE; } } |
SetPlayerTeamFromClass(playerid, classid) { Switch(classid) { case 0 :gTeam[playerid] = GROVE_STREET; case 1 :gTeam[playerid] = POLICE; } }
SetPlayerTeamFromClass(playerid, classid) { Switch(classid) { case 0,1,2:gTeam[playerid] = GROVE_STREET; case 3,4,5,6,7,8,9:gTeam[playerid] = POLICE; } }
SetPlayerTeamFromClass(playerid, classid) { Switch(classid) { case 0..2:gTeam[playerid] = GROVE_STREET; case 3..9:gTeam[playerid] = POLICE; } }
C:\Users\Machlik\Desktop\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(23) : warning 217: loose indentation C:\Users\Machlik\Desktop\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(290) : error 017: undefined symbol "SetPlayerTeamFromClass" C:\Users\Machlik\Desktop\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(306) : error 017: undefined symbol "SetPlayerTeamFromClass" C:\Users\Machlik\Desktop\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(308) : error 017: undefined symbol "classid" C:\Users\Machlik\Desktop\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(312) : error 017: undefined symbol "classid" C:\Users\Machlik\Desktop\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(318) : error 017: undefined symbol "SetPlayerToTeamColour" C:\Users\Machlik\Desktop\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(322) : error 035: argument type mismatch (argument 2) C:\Users\Machlik\Desktop\samp03bsvr_R2_win32\gamemodes\Untitled.pwn(326) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 7 Errors.
// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> #define GROVE_STREET 1 #define POLICE 2 #define GROVE_STREET_COLOUR 0x00820FAA #define POLICE_COLOUR 0x003DF5AA new gTeam[MAX_PLAYERS]; #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 OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("Blank Script"); AddPlayerClass(105,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0); //Grove Street Gang Member (0) AddPlayerClass(280,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Police Officer (1) return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerTeamFromClass(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) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { SetPlayerToTeamColour(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; } 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; } etPlayerTeamFromClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = GROVE_STREET; } if(classid == 1) { gTeam[playerid] = POLICE; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == GROVE_STREET) { SetPlayerColor(playerid,GROVE_STREET_COLOUR); //Green } if(gTeam[playerid] == POLICE) { SetPlayerColor(playerid,POLICE_COLOUR); // Blue } SetPlayerTeamFromClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = GROVE_STREET; } if(classid == 1) { gTeam[playerid] = POLICE; } } SetPlayerToTeamColour(playerid) { if(gTeam[playerid] == GROVE_STREET) { SetPlayerColor(playerid,GROVE_STREET_COLOUR); //Green } if(gTeam[playerid] == POLICE) { SetPlayerColor(playerid,POLICE_COLOUR); // Blue } }