Kill Point only in special Zone - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Kill Point only in special Zone (
/showthread.php?tid=212280)
Kill Point only in special Zone -
SanAndreasVille - 16.01.2011
hello i have this in my gamemod
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[playerid]==TEAM_GG && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258))
{
SendClientMessageToAll(0xFFB400FF, "Team 1 make a point!");
GivePlayerMoney(playerid, 100);
SCC++; }
if(gTeam[playerid]==TEAM_CC && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258))
{
SendClientMessageToAll(0xFFB400FF, "Team 2 make a point!");
GivePlayerMoney(playerid, 100);
SGG ++;
}
if(SCC==50)
{
for(new i=50; i < MAX_PLAYERS; i++)
{
GameTextForAll("~y~ Team 1 win",10000,3);
ForceClassSelection(playerid);
SCC=0;
SGG=0;
new string2[5];
valstr(string2, SCC);
TextDrawSetString(TextCC, string2);
valstr(string2, SGG);
TextDrawSetString(TextGG, string2);
}
SendClientMessageToAll(0xFFB400FF,"**Team 1 win**");
}
if(SGG==50)
{
for(new i=50; i < MAX_PLAYERS; i++)
{
GameTextForAll("~g~Team 2 win",10000,3);
ForceClassSelection(playerid);
SCC=0;
SGG=0;
new string3[5];
valstr(string3, SCC);
TextDrawSetString(TextCC, string3);
valstr(string3, SGG);
TextDrawSetString(TextGG, string3);
}
SendClientMessageToAll(0x00FF14FF,"** Team 2 win **");
}
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid));
}
return 1;
}
i want make a area "(-934.23,1389.667,-572.2159,1658.25
)" only in this area can i make a point for my team "SCC++;" how is wrong in my script what can i do ?
Respuesta: Kill Point only in special Zone -
[M]xFire - 16.01.2011
mayb usin a 'else' ex:
pawn Code:
if(gTeam[playerid]==TEAM_GG && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258))
{
//any here
}
else
if(gTeam[playerid]==TEAM_CC && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258))
{
//more here
}
else//if you have more...
Re: Kill Point only in special Zone -
SanAndreasVille - 16.01.2011
Code:
E:\.pwn(442) : warning 213: tag mismatch
E:\.pwn(442) : warning 202: number of arguments does not match definition
E:\.pwn(442) : error 029: invalid expression, assumed zero
this error is here:
Code:
if(gTeam[playerid]==TEAM_Cops && IsPlayerInArea(-934.23,1389.667,-572.2159,1658.258)))
Re: Kill Point only in special Zone -
Joe Staff - 16.01.2011
You forgot the 'playerid' parameter in IsPlayerInArea
Re: Kill Point only in special Zone -
SanAndreasVille - 16.01.2011
thanks it works !!