[Ajuda] Ajuda no /goto
#1

To tentando fazer um filterscript aqui so que o Pawno da crash todas vez que tento compilar

Ajuda pf

Код:
if(strcmp(cmd, "/goto", true) == 0)
    {
        #if !defined COLOR_DBLUE
        #define COLOR_DBLUE 0x7777DDFF
        #endif
        #if !defined COLOR_BLUE
        #define COLOR_BLUE 0x33CCFFAA
        #endif
        #if !defined COLOR_RED
        #define COLOR_RED 0xAA3333AA
        #endif
        new string[60];
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_DBLUE, "Uso correto: /goto [id do player]");
            return 1;
        }
        new Float:plocx,Float:plocy,Float:plocz;
        giveplayerid = strval(tmp);
        if(IsPlayerConnected(giveplayerid))
        {
            new PlayerName[30], GivePlayerName[30];
            GetPlayerName(playerid, PlayerName, 30);
            GetPlayerName(giveplayerid, GivePlayerName, 30);
            format(string, sizeof(string), "Vocк se teleportou para %s(%i).", GivePlayerName, giveplayerid);
            SendClientMessage(playerid, COLOR_BLUE, string);
            GetPlayerPos(giveplayerid, plocx, plocy, plocz);
            new intid = GetPlayerInterior(giveplayerid);
            SetPlayerInterior(playerid,intid);
            printf("[Command] %s usou /goto para se teleportar para %s.", PlayerName, GivePlayerName);
            if (GetPlayerState(playerid) == 2)
            {
                new tmpcar = GetPlayerVehicleID(playerid);
                SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
            }
            else
            {
                SetPlayerPos(playerid,plocx,plocy+2, plocz);
            }
        }
        else
        {
            format(string, sizeof(string), "%d nгo й um player ativo!", giveplayerid);
            SendClientMessage(playerid, COLOR_RED, string);
        }
        return 1;
    }
Reply
#2

Coloke isso no topo do gm
PHP код:
        #define COLOR_DBLUE
        #define COLOR_DBLUE 0x7777DDFF
        #define COLOR_BLUE
        #define COLOR_BLUE 0x33CCFFAA
        #define COLOR_RED
        #define COLOR_RED 0xAA3333AA 
aki o code
PHP код:
if(strcmp(cmd"/goto"true) == 0)
    {
        new 
string[60];
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_DBLUE"Uso correto: /goto [id do player]");
            return 
1;
        }
        new 
Float:plocx,Float:plocy,Float:plocz;
        
giveplayerid strval(tmp);
        if(
IsPlayerConnected(giveplayerid))
        {
            new 
PlayerName[30], GivePlayerName[30];
            
GetPlayerName(playeridPlayerName30);
            
GetPlayerName(giveplayeridGivePlayerName30);
            
format(stringsizeof(string), "Vocк se teleportou para %s(%i)."GivePlayerNamegiveplayerid);
            
SendClientMessage(playeridCOLOR_BLUEstring);
            
GetPlayerPos(giveplayeridplocxplocyplocz);
            new 
intid GetPlayerInterior(giveplayerid);
            
SetPlayerInterior(playerid,intid);
            
printf("[Command] %s usou /goto para se teleportar para %s."PlayerNameGivePlayerName);
         }
            if (
GetPlayerState(playerid) == 2)
            {
                new 
tmpcar GetPlayerVehicleID(playerid);
                
SetVehiclePos(tmpcarplocxplocy+4plocz);
            }else{
        
            
SetPlayerPos(playerid,plocx,plocy+2plocz);
            }else{
            
format(stringsizeof(string), "%d nгo й um player ativo!"giveplayerid);
            
SendClientMessage(playeridCOLOR_REDstring);
            }
           return 
1;
        } 
n mexi ne nada so consertei umas chaves ae que axo que tava errado i organizei tenta ae
Reply
#3

Continua dando Crash no pawno =| essa nem eu entendi parece estar tudo certinho
Reply
#4

possui algum erro grave ou faltando vбrias chaves no gamemode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)