[AJUDA]Comando /v
#6

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
Certo Obrigado ajudou e muito eu sofri para acha o FS ou script vlw.
Estou montando um GM por isso tava precisando deste comando ele tbm da certo com parte do nome do veнculo ou nome do veiculo?
Se der beleza, agora se nao der vou ter que alterar algumas coisas posso?
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)