[AJUDA]Goto e Salvar posiзгo
#3

pawn Code:
//TOPO
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;
}
//OnPlayerCommandText
new string[128],
cmd[30],
tmp[30],
idx;
if(!strcmp(cmd,"/goto", true))
{
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USE: /goto ID");
    new outro = strval(tmp);
    if(outro == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player desconhecido");
    new
        Float:X,
        Float:Y,
        Float:Z,
        nome[MAX_PLAYER_NAME]
    ;
    GetPlayerPos(outro, X, Y, Z);
    SetPlayerPos(playerid, X, Y ,Z);
    GetPlayerName(playerid, nome, sizeof(nome));
    format(string, 42," Vocк usou /goto no player %s", nome);
    SendClientMessage(playerid, -1, string);
    return true;
}
Ai й sу aprimorar avontade.
Reply


Messages In This Thread
[AJUDA]Goto e Salvar posiзгo - by .CrazZy._.[De] - 19.09.2011, 02:08
Re: [AJUDA]Goto e Salvar posiзгo - by CyNiC - 19.09.2011, 02:10
Re: [AJUDA]Goto e Salvar posiзгo - by WLSF - 19.09.2011, 02:15
Re: [AJUDA]Goto e Salvar posiзгo - by .CrazZy._.[De] - 19.09.2011, 02:29
Re: [AJUDA]Goto e Salvar posiзгo - by WLSF - 19.09.2011, 02:30
Re: [AJUDA]Goto e Salvar posiзгo - by .CrazZy._.[De] - 19.09.2011, 02:33
Re: [AJUDA]Goto e Salvar posiзгo - by WLSF - 19.09.2011, 02:35
Re: [AJUDA]Goto e Salvar posiзгo - by .CrazZy._.[De] - 19.09.2011, 02:47
Re: [AJUDA]Goto e Salvar posiзгo - by WLSF - 19.09.2011, 02:48
Re: [AJUDA]Goto e Salvar posiзгo - by .CrazZy._.[De] - 19.09.2011, 02:52

Forum Jump:


Users browsing this thread: 1 Guest(s)