SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 12/08/2011, 04:47 PM   #1
Skoll
Huge Clucker
 
Skoll's Avatar
 
Join Date: Aug 2011
Posts: 231
Reputation: 6
Post [Ajuda]~com um script~~

pawn Code:
if(strcmp(cmdtext,"/setlevel",true)==0)
    {
        new level, jugador[MAX_PLAYER_NAME];
        SetPlayerLevel(playerid, level);
        format(string, sizeof(string), "INFO: Level del %s setado para %s.", jugador, level);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        return 1;
        }

bom pessoal, eu queria que esse código funcionasse assim: /setlevel [id]
mas ele soh funciona /setlevel;
Skoll is offline   Reply With Quote
Old 12/08/2011, 04:53 PM   #2
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,012
Reputation: 635
Default Re: [Ajuda]~com um script~~

Usa strtok
__________________
ViniBorn is offline   Reply With Quote
Old 12/08/2011, 04:53 PM   #3
Josma_cmd
High-roller
 
Josma_cmd's Avatar
 
Join Date: Feb 2010
Location: Dukes - Liberty City
Posts: 1,415
Reputation: 111
Default Re: [Ajuda]~com um script~~

http://wiki.sa-mp.com/wiki/Strtok
__________________
Josma_cmd is offline   Reply With Quote
Old 12/08/2011, 05:32 PM   #4
CocaC0la
Big Clucker
 
CocaC0la's Avatar
 
Join Date: Jun 2011
Posts: 142
Reputation: 11
Default Re: [Ajuda]~com um script~~

http://forum.sa-mp.com/showthread.php?t=135260
CocaC0la is offline   Reply With Quote
Old 12/08/2011, 07:34 PM   #5
Skoll
Huge Clucker
 
Skoll's Avatar
 
Join Date: Aug 2011
Posts: 231
Reputation: 6
Default Re: [Ajuda]~com um script~~

obrigado;
Skoll is offline   Reply With Quote
Old 13/08/2011, 04:28 AM   #6
FreeGells
Big Clucker
 
FreeGells's Avatar
 
Join Date: Jul 2011
Location: Canoas - RS
Posts: 120
Reputation: 21
Default Re: [Ajuda]~com um script~~

pawn Code:
if(strcmp(cmd, "/setlevel", true) == 0)
{
    new str[128], tmp[128];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[ERRO] Você não é Admin!");
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, -1, "[ERRO] Use: /SetLevel [ID] [Level]");
    new PlayerB = strval(tmp);
    if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, -1, "[ERRO] Player Offline!");
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, -1, "[ERRO] Use: /SetLevel [ID] [Level]");
    new lv = strval(tmp);
    SetPlayerScore(PlayerB, lv);
    new n[MAX_PLAYER_NAME];
    GetPlayerName(PlayerB, n, MAX_PLAYER_NAME);
    format(str, sizeof str, "Você setou o level do Jogador %s Para %d!", n, lv);
    SendClientMessage(playerid, -1, str);
    return 1;
}

Espero ter ajudado!
__________________

Lós <3
FreeGells is offline   Reply With Quote
Old 14/08/2011, 11:08 PM   #7
Skoll
Huge Clucker
 
Skoll's Avatar
 
Join Date: Aug 2011
Posts: 231
Reputation: 6
Default Re: [Ajuda]~com um script~~

cara, tu ajudou de mais, espero que vcs nao pensem que eu quero tudo mastigado, alguns códigos eu fico o dia todo tentando fazer e não consigo, vir aqui q postar ajuda ou pedido é a última opção. Muito Obrigado;

Ps.: Só a assinatura do freegels ja vai fazer metade do meu server uahsuahsuas;
sistema de banco e de enquete são as pequenas coisas que ainda estão faltando no meu server para que ele fique praticamente pronto pra galera jogar na versao beta ;P.
Skoll is offline   Reply With Quote
Old 14/08/2011, 11:27 PM   #8
histire
High-roller
 
Join Date: Jul 2011
Posts: 1,160
Reputation: 27
Default Re: [Ajuda]~com um script~~

da uma olhada no que o Josma passou : http://wiki.sa-mp.com/wiki/Strtok
isso tah me ajudando
histire is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[AJUDA] Script lincon c Português/Portuguese 3 27/04/2011 03:44 PM
[Ajuda]Script adr_dls Português/Portuguese 3 15/08/2010 04:25 PM
[AJUDA] Add Script PROALLAN Português/Portuguese 0 27/07/2010 02:41 AM
Ajuda com Script mamedeste Português/Portuguese 2 12/01/2010 10:46 PM
[DUV] ajuda com meu script luck_vice Português/Portuguese 2 28/12/2009 05:42 PM


All times are GMT. The time now is 05:16 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.