Call Function
#1

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 !
Reply
#2

Show the loop where you called this function
Reply
#3

PHP код:
for(new iMAX_ZONES;i++)
    {
    if(
IsPlayerInRangeOfPoint(playerid5.0i) && IsPlayerInRangeOfPoint(killerid5.0i) && gTeam[killerid] != gTeam[playerid])
    {
    
GangZoneShowForAll(i,GetTeamColor(teamid));
    
SendClientMessage(killeridCOLOR_BLUE"You had taken this base !");
    
GivePlayerMoney(killerid1000);
    return 
1;
    }
    } 
Reply
#4

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 iMAX_ZONES;i++) 
    { 
    if(
IsPlayerInRangeOfPoint(playerid5.0i) && IsPlayerInRangeOfPoint(killerid5.0i) && gTeam[killerid] != gTeam[playerid]) 
    { 
    
GangZoneShowForAll(i,GetTeamColor(gTeam[killerid])); 
    
SendClientMessage(killeridCOLOR_BLUE"You had taken this base !"); 
    
GivePlayerMoney(killerid1000); 
    return 
1
    } 
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)