i have made a gangwar script, and when i put in 3 gang area's @ OnPlayerSpawn, it doesnt work, check these codes:
Код:
public OnPlayerConnect(playerid)
{
{
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has joined the server", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
}
SendClientMessage(playerid, 0x33AA33AA,"use /cmds to see all commands in this server");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname);
}
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "Balla", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, Balla_dbcar, 0);
SetPlayerSkin(playerid, 104);
SetPlayerColor(playerid, 0xFF00FFAA);
}
if(!strcmp(npcname, "Vagos", true))
{
PutPlayerInVehicle(playerid, Vagos_dbcar, 0);
SetPlayerSkin(playerid, 110);
SetPlayerColor(playerid, 0xFFFF00AA);
}
if(!strcmp(npcname, "Grove", true))
{
PutPlayerInVehicle(playerid, Grove_dbcar, 0);
SetPlayerSkin(playerid, 105);
SetPlayerColor(playerid, 0x33AA33AA);
}
}
if(gTeam[playerid] == TEAM_GROVE)//if team one when they spawn..
{
SetPlayerPos(playerid,2510.3369,-1673.5551,13.4290);//set player here..
SetPlayerColor(playerid, 0x33AA33AA);
}
if(gTeam[playerid] == TEAM_BALLA)//if team two when they spawn..
{
SetPlayerPos(playerid, 2173.9883,-1678.6250,15.0091);//set player here..
SetPlayerColor(playerid, 0xFFFF00AA);
}
if(gTeam[playerid] == TEAM_VAGOS)//if team three when they spawn..
{
SetPlayerPos(playerid, 2858.6323,-1308.2177,14.3633);//set player here..
SetPlayerColor(playerid, 0xFF00FFAA);
}
GangZoneShowForPlayer(playerid, GROVE, 0x00FF008B);
GangZoneShowForPlayer(playerid, VAGOS, 0xFFFF0096);
GangZoneShowForPlayer(playerid, BALLAS, 0x80008096);
SetPlayerWorldBounds(playerid, 2927.337, 1923.388, -1054.171, -1942.413);
}
this is just the part where the mistake is, but i dont see it.
So show 202 line not all your stuff.
Edit: I wrong read warning, you can ignore this warning its appeared for bad aligned script