[AJUDA]Comando /v
#8

Quote:
Originally Posted by rjjj
Посмотреть сообщение
Montei o cуdigo pra vocк:

pawn Код:
if(strcmp("/v", cmdtext, true, 1) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new idx;
            new tmp[256];
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /v [id do veнculo]");
                return 1;
            }
            new Float:X,Float:Y,Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            new vehid = CreateVehicle(strval(tmp), X,Y,Z, 0.0, 3, 3, 60000);
            PutPlayerInVehicle(playerid, vehid, 0);
            SendClientMessage(playerid, 0xFFFFFFAA, "Vocк criou um carro :O !");
        }
        return 1;
    }

Se der erro a respeito de "strtok" adicione no final do GameMode:


pawn Код:
stock strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}


Espero ter ajudado
Ae Rjjj deu erro na 'strtok' eu nao entendo muito bem ainda de pawn, estou estudando, e nao consegui resolver esse problema, da uma olhada:
pawn Код:
C:\server\filterscripts\DM.pwn(88) : warning 217: loose indentation
C:\server\filterscripts\DM.pwn(115) : warning 217: loose indentation
C:\server\filterscripts\DM.pwn(136) : error 029: invalid expression, assumed zero
C:\server\filterscripts\DM.pwn(136) : error 017: undefined symbol "string"
C:\server\filterscripts\DM.pwn(136) : error 017: undefined symbol "index"
C:\server\filterscripts\DM.pwn(136) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Nгo consegui consertar.
Reply


Messages In This Thread
[AJUDA]Comando /v - by ecl - 12.12.2010, 13:14
Re: [AJUDA]Comando /v - by [Ips]Guh - 12.12.2010, 14:07
Re: [AJUDA]Comando /v - by Katros - 12.12.2010, 16:18
Re: [AJUDA]Comando /v - by Macintosh - 12.12.2010, 16:20
Re: [AJUDA]Comando /v - by rjjj - 12.12.2010, 16:48
Re: [AJUDA]Comando /v - by ecl - 13.12.2010, 16:30
Re: [AJUDA]Comando /v - by TiagoPS - 13.12.2010, 17:11
Re: [AJUDA]Comando /v - by ecl - 13.12.2010, 18:13
Re: [AJUDA]Comando /v - by Pierox_ - 13.12.2010, 19:44

Forum Jump:


Users browsing this thread: 1 Guest(s)