Call Function - 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)
+--- Thread: Call Function (
/showthread.php?tid=558620)
Call Function -
nezo2001 - 18.01.2015
I have this function
PHP код:
stock GetTeamColor(teamid)
{
switch(teamid)
{
case GANG_GROVES: return 0x83F52C80;
case GANG_BALLAS: return 0xE0427F80;
case GANG_VAGOS: return 0xFFCC1180;
case GANG_AZTECAS: return 0x98F5FF80;
case GANG_TRIADS: return 0xD0209080;
case GANG_RIFAS: return 0x87CEFF80;
case GANG_DA_NANG_BOYS: return 0xCD5B4580;
case GANG_RUSSIAN_MAFIAS: return 0xEEDC8280;
case GANG_BIKER: return 0x584E5680;
}
return -1;
}
And i want to call it here
PHP код:
GangZoneShowForAll(i,GetTeamColor(teamid));
But it send to me
"Undefined symbol "teamid""
Please Help !
Re: Call Function -
ATGOggy - 18.01.2015
Show the loop where you called this function
Re: Call Function -
nezo2001 - 18.01.2015
PHP код:
for(new i; i < MAX_ZONES;i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, i) && IsPlayerInRangeOfPoint(killerid, 5.0, i) && gTeam[killerid] != gTeam[playerid])
{
GangZoneShowForAll(i,GetTeamColor(teamid));
SendClientMessage(killerid, COLOR_BLUE, "You had taken this base !");
GivePlayerMoney(killerid, 1000);
return 1;
}
}
Re: Call Function -
ATGOggy - 18.01.2015
You didn't define teamid anywhere in that callback or loop.
Try this if you want to get the teamid of killerid:
PHP код:
for(new i; i < MAX_ZONES;i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, i) && IsPlayerInRangeOfPoint(killerid, 5.0, i) && gTeam[killerid] != gTeam[playerid])
{
GangZoneShowForAll(i,GetTeamColor(gTeam[killerid]));
SendClientMessage(killerid, COLOR_BLUE, "You had taken this base !");
GivePlayerMoney(killerid, 1000);
return 1;
}
}