My gamemode isnt creating objects=?
#2

Example of a script that was working and doesnt work now: (doesnt create the object)

PHP код:
if(strcmp(cmd,"/sementes"true) == 0)
        {
            new 
x_nr[256];
            
x_nr strtok(cmdtextidx);
            if(!
strlen(x_nr)) {
                
SendClientMessage(playeridCOLOR_LIGHTRED,"{ADFF2F}[Comando]: {FFFFFF} /sementes [Comandos]");
                
SendClientMessage(playeridCOLOR_LIGHTRED,"{ADFF2F}[Comando]: {FFFFFF} plantar, colher");
                return 
1;
            }
            if(
strcmp(x_nr,"plantar",true) == 0)
            {
                if(
IsPlayerConnected(playerid))
                {
                    if(
PlayerInfo[playerid][pFaction] == || PlayerInfo[playerid][pFaction] == 8)
                    {
                        if(
PlayerInfo[playerid][pSementes] > 0)
                        {
                            for(new 
0;c<sizeof(DrugInfo);c++)
                            {
                                if(
DrugInfo[c][sementecrescimento] == 0)
                                {
                                new 
Float:x;
                                new 
Float:y;
                                new 
Float:z;
                                
ApplyAnimation(playerid"BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
                                
ApplyAnimation(playerid"BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
                                
GetPlayerPos(playeridxyz);
                                
DrugInfo[c][semente] = CreateDynamicObject(19473xyz-1.00000);
                                
DrugInfo[c][sementeposX] = x;
                                
DrugInfo[c][sementeposY] = y;
                                
DrugInfo[c][sementeposZ] = z-1.0;
                                
DrugInfo[c][drogacolher] = 0;
                                
DrugInfo[c][sementecrescimento] = 1;
                                
PlayerInfo[playerid][pSementes] -= 1;
                                
SetTimerEx("crescer"5000false"i"c);
                                
SendClientMessage(playeridCOLOR_WHITE"[Info] Plantas-te uma semente de cocaina. Terбs que esperar algum tempo antes de a colher.");
                                return 
1;
                                }
                            }
                            return 
1;
                        }
                        else
                        {
                        
SendClientMessage(playeridCOLOR_RED"[Erro]: Nao tens sementes suficientes!");
                        return 
1;
                        }
                    }
                    else
                    {
                    
SendClientMessage(playeridCOLOR_RED"[Erro]: Nao pertences а faction que trafica drogas");
                    return 
1;
                    }
                }
            }
            else if(
strcmp(x_nr,"colher",true) == 0)
            {
                if(
PlayerInfo[playerid][pFaction] == || PlayerInfo[playerid][pFaction] == 8)
                {
                    for(new 
0sizeof(DrugInfo); c++)
                    {
                        if(
IsPlayerInRangeOfPoint(playerid3.0DrugInfo[c][sementeposX], DrugInfo[c][sementeposY], DrugInfo[c][sementeposZ]))
                        {
                            if(
DrugInfo[c][drogacolher] == 1)
                            {
                                
ApplyAnimation(playerid"BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
                                
DrugInfo[c][drogacolher] = 0;
                                
DestroyDynamicObject(DrugInfo[c][semente]);
                                
DrugInfo[c][sementecrescimento] = 0;
                                
DrugsHolding[playerid] += 5;
                                
DrugInfo[c][sementeposX] = 0;
                                
DrugInfo[c][sementeposY] = 0;
                                
DrugInfo[c][sementeposZ] = 0;
                                return 
SendClientMessage(playeridCOLOR_WHITE"[Info]: Colheste a tua planta. Agora para a transformares tens que a entregar ao teu trabalhador.");
                            }
                            return 
SendClientMessage(playeridCOLOR_RED"[Erro]: A planta ainda nao cresceu! Espera mais tempo.");
                        }
                    } 
// this \/ message was inside the loop, should be here
                    
return SendClientMessage(playeridCOLOR_RED"[Erro]: Nao estas perto de nenhuma planta de cocaina!");
                }
                return 
SendClientMessage(playeridCOLOR_RED"[Erro]: Nao pertences a faction que vende drogas!");
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED,"{FF0000}[Erro]: {FFFFFF}Comando Invalido.");
                return 
1;
            }
            return 
1;
        }
        

Reply


Messages In This Thread
My gamemode isnt creating objects=? - by GunZsmd - 19.07.2016, 16:39
Re: My gamemode isnt creating objects=? - by GunZsmd - 19.07.2016, 16:47
Re: My gamemode isnt creating objects=? - by Alpay0098 - 19.07.2016, 16:47
Re: My gamemode isnt creating objects=? - by GunZsmd - 19.07.2016, 16:53
Re: My gamemode isnt creating objects=? - by GunZsmd - 19.07.2016, 18:21
Re: My gamemode isnt creating objects=? - by Logic_ - 19.07.2016, 18:40
Re: My gamemode isnt creating objects=? - by GunZsmd - 19.07.2016, 21:38
Re: My gamemode isnt creating objects=? - by GunZsmd - 19.07.2016, 21:50
Re: My gamemode isnt creating objects=? - by GunZsmd - 19.07.2016, 22:47
Re: My gamemode isnt creating objects=? - by GunZsmd - 20.07.2016, 10:47

Forum Jump:


Users browsing this thread: 1 Guest(s)