help for this mestake (capture :screenshot) -
BlacKxStory - 17.01.2012
Hi all Guys In the forume ....
guys i need enything he can help me pleasee
Subject: so i want if a player enytre in a checkpoint (look at image ) he stay 30 sec and he capture the zone for her teame and he reserve a score and money
The problem 1: look at the pectures i stay 30 sec but i reserver money and score he isen't stope
The problem 2: and the zone his colore stay he isen't changed in the colore of teame
so can some one help me
The pectures:
PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define TEAM_Latino 1
#define TEAM_Souviet 2
#define TEAM_Arabian 3
#define TEAM_USA 4
#define TEAM_Europian 5
#define TEAM_Japan 6
#define TEAM_Taliban 7
#define TEAM_Latino_COLOR 0x00F3FFAF
#define TEAM_Souviet_COLOR 0xCA0000FF
#define TEAM_Arabian_COLOR 0xD70000FF
#define TEAM_USA_COLOR 0x1400C3FF
#define TEAM_Europian_COLOR 0x005E0089
#define TEAM_Japan_COLOR 0xFAFAFFFF
#define TEAM_Taliban_COLOR 0xFFFFFFFF
new gTeam[MAX_PLAYERS];
#define MAX_CPS 500 //Change it if you need more or less
enum Info //CP ENUM
{
Float:CPX, //Xpos
Float:CPY, //Ypos
Float:CPZ, //Zpos
Float:Size, //Size of the CP
Float:Viewdist //Viewdistance
};
new CPID = -1; //CPID
new PlayerCP[MAX_PLAYERS] = -1; //PlayerCheckpoints (Only one can be active at once).
new CPinfo[MAX_CPS][Info]; //CPINFO
new CPActive[MAX_PLAYERS][MAX_CPS]; //CPActive for player
new CPDisabled[MAX_CPS]; //For disabling checkpoints
new desertairport;
stock CreateCheckpoint(playerid, Float:cpX, Float:cpY, Float:cpZ, Float:cpSize, Float:viewdist = 35.0)
{
CPID ++; //CPID
CPinfo[CPID][CPX] = cpX; //CPX Pos
CPinfo[CPID][CPY] = cpY; //CPY Pos
CPinfo[CPID][CPZ] = cpZ; //CPZ Pos
CPinfo[CPID][Size] = cpSize; //Checkpoint Size
CPinfo[CPID][Viewdist] = viewdist; //View distance
if(playerid != -1)
{
CPActive[playerid][CPID] ++; //Makes the player able to view that checkpoint
}
if(playerid == -1)
{
for(new i; i<MAX_PLAYERS; i++)
{
CPActive[i][CPID] ++;
}
}
return CPID;
}
new CPS1;
forward SetZone(playerid);
public SetZone(playerid)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)+5 );
GivePlayerMoney(playerid,500);
SendClientMessage(playerid,0xFFFFFFFF,"You've capture the zone and receive 500 $ and 5 score");
if (gTeam[playerid] == TEAM_Latino)
{
GangZoneShowForAll(desertairport,TEAM_Latino_COLOR);
}
else if (gTeam[playerid] == TEAM_Souviet)
{
GangZoneShowForAll(desertairport,TEAM_Souviet_COLOR);
}
else if (gTeam[playerid] == TEAM_Arabian)
{
GangZoneShowForAll(desertairport, TEAM_Arabian_COLOR);
}
else if (gTeam[playerid] == TEAM_USA)
{
GangZoneShowForAll(desertairport, TEAM_USA_COLOR);
}
else if (gTeam[playerid] == TEAM_Europian)
{
GangZoneShowForAll(desertairport, TEAM_Europian_COLOR);
}
else if (gTeam[playerid] == TEAM_Japan)
{
GangZoneShowForAll(desertairport, TEAM_Japan_COLOR);
}
else if (gTeam[playerid] == TEAM_Taliban)
{
GangZoneShowForAll(desertairport, TEAM_Taliban_COLOR);
}
return 1;
}
public OnGameModeInit()
{
desertairport = GangZoneCreate(198,5239, 2405,642, 478,7929, 2580,811);
UsePlayerPedAnims();
AddPlayerClass(108,1091.8289,1892.5746,10.8203,181.3648,0,0,0,0,0,0); //Latino (0)
AddPlayerClass(206,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Souviet (1)
AddPlayerClass(179,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Arabian(2)
AddPlayerClass(287,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //USA (3)
AddPlayerClass(285,-148.1873,1142.0114,19.7422,16.0408,0,0,0,0,0,0); //Europian(4)
AddPlayerClass(188,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Japan (5).
AddPlayerClass(163,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Taliban(6)
SetTimer("Stream", 300, true);
CPS1 = CreateCheckpoint(-1, 1058.3783,1013.4809,11.0000, 3.0, 20.0); //hospital
CPS1 = CreateCheckpoint(-1, 1058.3783,1013.4809,11.0000, 3.0, 20.0);
CPS1 = CreateCheckpoint(-1, 1058.3783,1013.4809,11.0000, 3.0, 20.0);
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
forward Stream();
public Stream()
{
for(new i; i < MAX_PLAYERS; i ++) //Loops through 500 players
{
if(IsPlayerConnected(i)) //Brings the 500 players down to the online ones
{
PlayerCP[i] = -1;
for(new j; j < CPID + 1; j ++) //Loops through all CP's
{
if(CPDisabled[j] == 0) //Checks if the CP is disabled.
{
if(IsPlayerInRangeOfPoint(i, CPinfo[j][Viewdist], CPinfo[j][CPX], CPinfo[j][CPY], CPinfo[j][CPZ]) && CPActive[i][j] == 1) //Is the player in range of a CP
{
SetPlayerCheckpoint(i, CPinfo[j][CPX], CPinfo[j][CPY], CPinfo[j][CPZ], CPinfo[j][Size]);//Sets the player checkpoint
PlayerCP[i] = j; //Sets the player checkpoint to that in the variable.
printf("PCP:%d", j);
}
}
}
if(PlayerCP[i] == -1) //If there is no CP close enough
{
print("NAHBRO");
PlayerCP[i] = -1; //PlayerCP isn't anything
DisablePlayerCheckpoint(i); //Disable any checkpoint visible.
continue;
}
}
}
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)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0)
{
gTeam[playerid] = TEAM_Latino;
}
else if (classid == 1)
{
gTeam[playerid] = TEAM_Souviet;
}
else if (classid == 2)
{
gTeam[playerid] = TEAM_Arabian;
}
else if (classid == 3)
{
gTeam[playerid] = TEAM_USA;
}
else if (classid == 4)
{
gTeam[playerid] = TEAM_Europian;
}
else if (classid == 5)
{
gTeam[playerid] = TEAM_Japan;
}
else if (classid == 6)
{
gTeam[playerid] = TEAM_Taliban;
}
}
SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_Latino)
{
SetPlayerColor(playerid, TEAM_Latino_COLOR);
}
else if (gTeam[playerid] == TEAM_Souviet)
{
SetPlayerColor(playerid, TEAM_Souviet_COLOR);
}
else if (gTeam[playerid] == TEAM_Arabian)
{
SetPlayerColor(playerid, TEAM_Arabian_COLOR);
}
else if (gTeam[playerid] == TEAM_USA)
{
SetPlayerColor(playerid, TEAM_USA_COLOR);
}
else if (gTeam[playerid] == TEAM_Europian)
{
SetPlayerColor(playerid, TEAM_Europian_COLOR);
}
else if (gTeam[playerid] == TEAM_Japan)
{
SetPlayerColor(playerid, TEAM_Japan_COLOR);
}
else if (gTeam[playerid] == TEAM_Taliban)
{
SetPlayerColor(playerid, TEAM_Taliban_COLOR);
}
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)
{
if(PlayerCP[playerid] != -1) return OnPlayerEnterStreamedCheckpoint(playerid, PlayerCP[playerid]);
return 1;
}
stock OnPlayerEnterStreamedCheckpoint(playerid, CPiD)
{
if(CPiD == CPS1)
{
GameTextForPlayer(playerid, "Stay her to capture hospital!", 3000, 3);
SetTimerEx("SetZone",20000,false,"i",playerid);
}
return 1;
}
stock DestroyCheckpoint(CPiD) //Destory's a checkpoint
{
CPDisabled[CPiD] = 1;
for(new i; i< MAX_PLAYERS; i++)
{
if(PlayerCP[i] == CPiD)
{
DisablePlayerCheckpoint(i);
}
}
}
stock TogglePlayerCheckpoint(playerid, CPiD, toggled) //Toggles a checkpoint for a player 0 = Not active, 1 = active :)
{
CPActive[playerid][CPiD] = toggled;
}
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;
}
Re: help for this mestake (capture :screenshot) -
thimo - 17.01.2012
Ok so whats your problem? ur english isnt good in that picture!
Re: help for this mestake (capture :screenshot) -
mineralo - 17.01.2012
pawn Код:
forward SetZone(playerid);
public SetZone(playerid)
{
if (gTeam[playerid] == TEAM_Latino)
{
GangZoneShowForAll(gangzone,TEAM_Latino_COLOR);
}
else if (gTeam[playerid] == TEAM_Souviet)
{
GangZoneShowForAll(gangzone,TEAM_Souviet_COLOR);
}
else if (gTeam[playerid] == TEAM_Arabian)
{
GangZoneShowForAll(gangzone, TEAM_Arabian_COLOR);
}
else if (gTeam[playerid] == TEAM_USA)
{
GangZoneShowForAll(gangzone, TEAM_USA_COLOR);
}
else if (gTeam[playerid] == TEAM_Europian)
{
GangZoneShowForAll(gangzone, TEAM_Europian_COLOR);
}
else if (gTeam[playerid] == TEAM_Japan)
{
GangZoneShowForAll(gangzone, TEAM_Japan_COLOR);
}
else if (gTeam[playerid] == TEAM_Taliban)
{
GangZoneShowForAll(gangzone, TEAM_Taliban_COLOR);
}
SetPlayerScore(playerid,GetPlayerScore(playerid)+5 );
GivePlayerMoney(playerid,500);
SendClientMessage(playerid,0xFFFFFFFF,"You've capture the zone and receive 500 $ and 5 score");
return 1;
}
try this, it should solve the spamming
Re : help for this mestake (capture :screenshot) -
BlacKxStory - 17.01.2012
hh dude im frome morocco and sorry for my bead english my probleme is i want if you stay in the zone 30 sec you capture this zone (like teame latino he's colore is red and teame usa he's colore is black if latino capture a zone the zone wil be red )
AW: help for this mestake (capture :screenshot) -
BlacKxStory - 17.01.2012
romove
AW: help for this mestake (capture :screenshot) -
BlacKxStory - 17.01.2012
now i will show all what i mean for capture zone with timer i want like that
The Vedio:
http://www.youtube.com/watch?v=aooGCI27x5Y#
can some one help me now
!
PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define TEAM_Latino 1
#define TEAM_Souviet 2
#define TEAM_Arabian 3
#define TEAM_USA 4
#define TEAM_Europian 5
#define TEAM_Japan 6
#define TEAM_Taliban 7
#define TEAM_Latino_COLOR 0x00F3FFAF
#define TEAM_Souviet_COLOR 0xCA0000FF
#define TEAM_Arabian_COLOR 0xD70000FF
#define TEAM_USA_COLOR 0x1400C3FF
#define TEAM_Europian_COLOR 0x005E0089
#define TEAM_Japan_COLOR 0xFAFAFFFF
#define TEAM_Taliban_COLOR 0xFFFFFFFF
new gTeam[MAX_PLAYERS];
#define MAX_CPS 500 //Change it if you need more or less
enum Info //CP ENUM
{
Float:CPX, //Xpos
Float:CPY, //Ypos
Float:CPZ, //Zpos
Float:Size, //Size of the CP
Float:Viewdist //Viewdistance
};
new CPID = -1; //CPID
new PlayerCP[MAX_PLAYERS] = -1; //PlayerCheckpoints (Only one can be active at once).
new CPinfo[MAX_CPS][Info]; //CPINFO
new CPActive[MAX_PLAYERS][MAX_CPS]; //CPActive for player
new CPDisabled[MAX_CPS]; //For disabling checkpoints
new desertairport;
stock CreateCheckpoint(playerid, Float:cpX, Float:cpY, Float:cpZ, Float:cpSize, Float:viewdist = 35.0)
{
CPID ++; //CPID
CPinfo[CPID][CPX] = cpX; //CPX Pos
CPinfo[CPID][CPY] = cpY; //CPY Pos
CPinfo[CPID][CPZ] = cpZ; //CPZ Pos
CPinfo[CPID][Size] = cpSize; //Checkpoint Size
CPinfo[CPID][Viewdist] = viewdist; //View distance
if(playerid != -1)
{
CPActive[playerid][CPID] ++; //Makes the player able to view that checkpoint
}
if(playerid == -1)
{
for(new i; i<MAX_PLAYERS; i++)
{
CPActive[i][CPID] ++;
}
}
return CPID;
}
new CPS1;
forward SetZone(playerid);
public SetZone(playerid)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)+5 );
GivePlayerMoney(playerid,500);
SendClientMessage(playerid,0xFFFFFFFF,"You've capture the zone and receive 500 $ and 5 score");
if (gTeam[playerid] == TEAM_Latino)
{
GangZoneShowForAll(desertairport,TEAM_Latino_COLOR);
}
else if (gTeam[playerid] == TEAM_Souviet)
{
GangZoneShowForAll(desertairport,TEAM_Souviet_COLOR);
}
else if (gTeam[playerid] == TEAM_Arabian)
{
GangZoneShowForAll(desertairport, TEAM_Arabian_COLOR);
}
else if (gTeam[playerid] == TEAM_USA)
{
GangZoneShowForAll(desertairport, TEAM_USA_COLOR);
}
else if (gTeam[playerid] == TEAM_Europian)
{
GangZoneShowForAll(desertairport, TEAM_Europian_COLOR);
}
else if (gTeam[playerid] == TEAM_Japan)
{
GangZoneShowForAll(desertairport, TEAM_Japan_COLOR);
}
else if (gTeam[playerid] == TEAM_Taliban)
{
GangZoneShowForAll(desertairport, TEAM_Taliban_COLOR);
}
return 1;
}
public OnGameModeInit()
{
desertairport = GangZoneCreate(198,5239, 2405,642, 478,7929, 2580,811);
UsePlayerPedAnims();
AddPlayerClass(108,1091.8289,1892.5746,10.8203,181.3648,0,0,0,0,0,0); //Latino (0)
AddPlayerClass(206,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Souviet (1)
AddPlayerClass(179,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Arabian(2)
AddPlayerClass(287,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //USA (3)
AddPlayerClass(285,-148.1873,1142.0114,19.7422,16.0408,0,0,0,0,0,0); //Europian(4)
AddPlayerClass(188,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Japan (5).
AddPlayerClass(163,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Taliban(6)
SetTimer("Stream", 300, true);
CPS1 = CreateCheckpoint(-1, 1058.3783,1013.4809,11.0000, 3.0, 20.0); //hospital
CPS1 = CreateCheckpoint(-1, 1058.3783,1013.4809,11.0000, 3.0, 20.0);
CPS1 = CreateCheckpoint(-1, 1058.3783,1013.4809,11.0000, 3.0, 20.0);
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
forward Stream();
public Stream()
{
for(new i; i < MAX_PLAYERS; i ++) //Loops through 500 players
{
if(IsPlayerConnected(i)) //Brings the 500 players down to the online ones
{
PlayerCP[i] = -1;
for(new j; j < CPID + 1; j ++) //Loops through all CP's
{
if(CPDisabled[j] == 0) //Checks if the CP is disabled.
{
if(IsPlayerInRangeOfPoint(i, CPinfo[j][Viewdist], CPinfo[j][CPX], CPinfo[j][CPY], CPinfo[j][CPZ]) && CPActive[i][j] == 1) //Is the player in range of a CP
{
SetPlayerCheckpoint(i, CPinfo[j][CPX], CPinfo[j][CPY], CPinfo[j][CPZ], CPinfo[j][Size]);//Sets the player checkpoint
PlayerCP[i] = j; //Sets the player checkpoint to that in the variable.
printf("PCP:%d", j);
}
}
}
if(PlayerCP[i] == -1) //If there is no CP close enough
{
print("NAHBRO");
PlayerCP[i] = -1; //PlayerCP isn't anything
DisablePlayerCheckpoint(i); //Disable any checkpoint visible.
continue;
}
}
}
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)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0)
{
gTeam[playerid] = TEAM_Latino;
}
else if (classid == 1)
{
gTeam[playerid] = TEAM_Souviet;
}
else if (classid == 2)
{
gTeam[playerid] = TEAM_Arabian;
}
else if (classid == 3)
{
gTeam[playerid] = TEAM_USA;
}
else if (classid == 4)
{
gTeam[playerid] = TEAM_Europian;
}
else if (classid == 5)
{
gTeam[playerid] = TEAM_Japan;
}
else if (classid == 6)
{
gTeam[playerid] = TEAM_Taliban;
}
}
SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_Latino)
{
SetPlayerColor(playerid, TEAM_Latino_COLOR);
}
else if (gTeam[playerid] == TEAM_Souviet)
{
SetPlayerColor(playerid, TEAM_Souviet_COLOR);
}
else if (gTeam[playerid] == TEAM_Arabian)
{
SetPlayerColor(playerid, TEAM_Arabian_COLOR);
}
else if (gTeam[playerid] == TEAM_USA)
{
SetPlayerColor(playerid, TEAM_USA_COLOR);
}
else if (gTeam[playerid] == TEAM_Europian)
{
SetPlayerColor(playerid, TEAM_Europian_COLOR);
}
else if (gTeam[playerid] == TEAM_Japan)
{
SetPlayerColor(playerid, TEAM_Japan_COLOR);
}
else if (gTeam[playerid] == TEAM_Taliban)
{
SetPlayerColor(playerid, TEAM_Taliban_COLOR);
}
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)
{
if(PlayerCP[playerid] != -1) return OnPlayerEnterStreamedCheckpoint(playerid, PlayerCP[playerid]);
return 1;
}
stock OnPlayerEnterStreamedCheckpoint(playerid, CPiD)
{
if(CPiD == CPS1)
{
GameTextForPlayer(playerid, "Stay her to capture hospital!", 3000, 3);
SetTimerEx("SetZone",20000,false,"i",playerid);
}
return 1;
}
stock DestroyCheckpoint(CPiD) //Destory's a checkpoint
{
CPDisabled[CPiD] = 1;
for(new i; i< MAX_PLAYERS; i++)
{
if(PlayerCP[i] == CPiD)
{
DisablePlayerCheckpoint(i);
}
}
}
stock TogglePlayerCheckpoint(playerid, CPiD, toggled) //Toggles a checkpoint for a player 0 = Not active, 1 = active :)
{
CPActive[playerid][CPiD] = toggled;
}
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;
}
Re: help for this mestake (capture :screenshot) -
BlacKxStory - 18.01.2012
guys look at the vedio he will show all what i want with capture zone for a team and thx
Re: help for this mestake (capture :screenshot) -
thimo - 18.01.2012
Set a variable to 1 like if he captures APlayerdata[playerid][Captured] = 1;
And use if to see if its already owned
Re: help for this mestake (capture :screenshot) -
BlacKxStory - 18.01.2012
can you scripte it in my pawno give me just in a 1 example in this zone
198,5239, 2405,642, 478,7929, 2580,811
her :
PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define TEAM_Latino 1
#define TEAM_Souviet 2
#define TEAM_Arabian 3
#define TEAM_USA 4
#define TEAM_Europian 5
#define TEAM_Japan 6
#define TEAM_Taliban 7
#define TEAM_Latino_COLOR 0x00F3FFAF
#define TEAM_Souviet_COLOR 0xCA0000FF
#define TEAM_Arabian_COLOR 0xD70000FF
#define TEAM_USA_COLOR 0x1400C3FF
#define TEAM_Europian_COLOR 0x005E0089
#define TEAM_Japan_COLOR 0xFAFAFFFF
#define TEAM_Taliban_COLOR 0xFFFFFFFF
new gTeam[MAX_PLAYERS];
#define MAX_CPS 500 //Change it if you need more or less
enum Info //CP ENUM
{
Float:CPX, //Xpos
Float:CPY, //Ypos
Float:CPZ, //Zpos
Float:Size, //Size of the CP
Float:Viewdist //Viewdistance
};
new CPID = -1; //CPID
new PlayerCP[MAX_PLAYERS] = -1; //PlayerCheckpoints (Only one can be active at once).
new CPinfo[MAX_CPS][Info]; //CPINFO
new CPActive[MAX_PLAYERS][MAX_CPS]; //CPActive for player
new CPDisabled[MAX_CPS]; //For disabling checkpoints
new desertairport;
stock CreateCheckpoint(playerid, Float:cpX, Float:cpY, Float:cpZ, Float:cpSize, Float:viewdist = 35.0)
{
CPID ++; //CPID
CPinfo[CPID][CPX] = cpX; //CPX Pos
CPinfo[CPID][CPY] = cpY; //CPY Pos
CPinfo[CPID][CPZ] = cpZ; //CPZ Pos
CPinfo[CPID][Size] = cpSize; //Checkpoint Size
CPinfo[CPID][Viewdist] = viewdist; //View distance
if(playerid != -1)
{
CPActive[playerid][CPID] ++; //Makes the player able to view that checkpoint
}
if(playerid == -1)
{
for(new i; i<MAX_PLAYERS; i++)
{
CPActive[i][CPID] ++;
}
}
return CPID;
}
new CPS1;
forward SetZone(playerid);
public SetZone(playerid)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)+5 );
GivePlayerMoney(playerid,500);
SendClientMessage(playerid,0xFFFFFFFF,"You've capture the zone and receive 500 $ and 5 score");
if (gTeam[playerid] == TEAM_Latino)
{
GangZoneShowForAll(desertairport,TEAM_Latino_COLOR);
}
else if (gTeam[playerid] == TEAM_Souviet)
{
GangZoneShowForAll(desertairport,TEAM_Souviet_COLOR);
}
else if (gTeam[playerid] == TEAM_Arabian)
{
GangZoneShowForAll(desertairport, TEAM_Arabian_COLOR);
}
else if (gTeam[playerid] == TEAM_USA)
{
GangZoneShowForAll(desertairport, TEAM_USA_COLOR);
}
else if (gTeam[playerid] == TEAM_Europian)
{
GangZoneShowForAll(desertairport, TEAM_Europian_COLOR);
}
else if (gTeam[playerid] == TEAM_Japan)
{
GangZoneShowForAll(desertairport, TEAM_Japan_COLOR);
}
else if (gTeam[playerid] == TEAM_Taliban)
{
GangZoneShowForAll(desertairport, TEAM_Taliban_COLOR);
}
return 1;
}
public OnGameModeInit()
{
desertairport = GangZoneCreate(198,5239, 2405,642, 478,7929, 2580,811);
UsePlayerPedAnims();
AddPlayerClass(108,1091.8289,1892.5746,10.8203,181.3648,0,0,0,0,0,0); //Latino (0)
AddPlayerClass(206,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Souviet (1)
AddPlayerClass(179,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Arabian(2)
AddPlayerClass(287,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //USA (3)
AddPlayerClass(285,-148.1873,1142.0114,19.7422,16.0408,0,0,0,0,0,0); //Europian(4)
AddPlayerClass(188,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Japan (5).
AddPlayerClass(163,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Taliban(6)
SetTimer("Stream", 300, true);
CPS1 = CreateCheckpoint(-1, 1058.3783,1013.4809,11.0000, 3.0, 20.0); //hospital
CPS1 = CreateCheckpoint(-1, 1058.3783,1013.4809,11.0000, 3.0, 20.0);
CPS1 = CreateCheckpoint(-1, 1058.3783,1013.4809,11.0000, 3.0, 20.0);
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
forward Stream();
public Stream()
{
for(new i; i < MAX_PLAYERS; i ++) //Loops through 500 players
{
if(IsPlayerConnected(i)) //Brings the 500 players down to the online ones
{
PlayerCP[i] = -1;
for(new j; j < CPID + 1; j ++) //Loops through all CP's
{
if(CPDisabled[j] == 0) //Checks if the CP is disabled.
{
if(IsPlayerInRangeOfPoint(i, CPinfo[j][Viewdist], CPinfo[j][CPX], CPinfo[j][CPY], CPinfo[j][CPZ]) && CPActive[i][j] == 1) //Is the player in range of a CP
{
SetPlayerCheckpoint(i, CPinfo[j][CPX], CPinfo[j][CPY], CPinfo[j][CPZ], CPinfo[j][Size]);//Sets the player checkpoint
PlayerCP[i] = j; //Sets the player checkpoint to that in the variable.
printf("PCP:%d", j);
}
}
}
if(PlayerCP[i] == -1) //If there is no CP close enough
{
print("NAHBRO");
PlayerCP[i] = -1; //PlayerCP isn't anything
DisablePlayerCheckpoint(i); //Disable any checkpoint visible.
continue;
}
}
}
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)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0)
{
gTeam[playerid] = TEAM_Latino;
}
else if (classid == 1)
{
gTeam[playerid] = TEAM_Souviet;
}
else if (classid == 2)
{
gTeam[playerid] = TEAM_Arabian;
}
else if (classid == 3)
{
gTeam[playerid] = TEAM_USA;
}
else if (classid == 4)
{
gTeam[playerid] = TEAM_Europian;
}
else if (classid == 5)
{
gTeam[playerid] = TEAM_Japan;
}
else if (classid == 6)
{
gTeam[playerid] = TEAM_Taliban;
}
}
SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_Latino)
{
SetPlayerColor(playerid, TEAM_Latino_COLOR);
}
else if (gTeam[playerid] == TEAM_Souviet)
{
SetPlayerColor(playerid, TEAM_Souviet_COLOR);
}
else if (gTeam[playerid] == TEAM_Arabian)
{
SetPlayerColor(playerid, TEAM_Arabian_COLOR);
}
else if (gTeam[playerid] == TEAM_USA)
{
SetPlayerColor(playerid, TEAM_USA_COLOR);
}
else if (gTeam[playerid] == TEAM_Europian)
{
SetPlayerColor(playerid, TEAM_Europian_COLOR);
}
else if (gTeam[playerid] == TEAM_Japan)
{
SetPlayerColor(playerid, TEAM_Japan_COLOR);
}
else if (gTeam[playerid] == TEAM_Taliban)
{
SetPlayerColor(playerid, TEAM_Taliban_COLOR);
}
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)
{
if(PlayerCP[playerid] != -1) return OnPlayerEnterStreamedCheckpoint(playerid, PlayerCP[playerid]);
return 1;
}
stock OnPlayerEnterStreamedCheckpoint(playerid, CPiD)
{
if(CPiD == CPS1)
{
GameTextForPlayer(playerid, "Stay her to capture hospital!", 3000, 3);
SetTimerEx("SetZone",20000,false,"i",playerid);
}
return 1;
}
stock DestroyCheckpoint(CPiD) //Destory's a checkpoint
{
CPDisabled[CPiD] = 1;
for(new i; i< MAX_PLAYERS; i++)
{
if(PlayerCP[i] == CPiD)
{
DisablePlayerCheckpoint(i);
}
}
}
stock TogglePlayerCheckpoint(playerid, CPiD, toggled) //Toggles a checkpoint for a player 0 = Not active, 1 = active :)
{
CPActive[playerid][CPiD] = toggled;
}
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;
}