[AJUDA]Tenho uma fs que de vip
#1

tenho uma fs de vip sу que quando vou compilar ela da 26 erros alguem pode me ajudar o que ta faltando ?






PHP код:
[PHP][PHP]#include <Dini> 
new VIP[MAX_PLAYERS];
 
new 
cmd[256], idx
cmd strtok(cmdtextidx); 
public 
OnPlayerConnect(playerid

    new 
file[30], n[24]; 
    
GetPlayerName(playeridn24); 
    
format(file30"%s.txt"n); 
    if(
fexist(file)) { VIP[playerid] = dini_Int(file"VIP"); } 
    else  
    {  
        
dini_Create(file); 
        
VIP[playerid] = 0
    } 
    return 
1

public 
OnPlayerDisconnect(playeridreason

    new 
file[30], n[24]; 
    
GetPlayerName(playeridn24); 
    
format(file30"%s.txt"n); 
    
dini_IntSet(file"VIP"VIP[playerid]); 
    return 
1

public 
OnPlayerCommandText(playeridcmdtext[]) 

    new 
cmd[256], idx
    
cmd strtok(cmdtextidx); 
    if(
strcmp(cmd"/kitvipo"true) == 0
    { 
        if(
VIP[playerid] < 3) return SendClientMessage(playerid, -1"Vocк nгo й Vip Ouro."); 
        
GivePlayerWeapon(playerid243000); 
        
GivePlayerWeapon(playerid293000); 
        
GivePlayerWeapon(playerid313000); 
        
SetPlayerArmour(playerid90); 
        return 
1
    } 
    if(
strcmp(cmd"/kitvipp"true) == 0
    { 
        if(
VIP[playerid] < 2) return SendClientMessage(playerid, -1"Vocк nгo й Vip Prata."); 
        
GivePlayerWeapon(playerid242000); 
        
GivePlayerWeapon(playerid292000); 
        
GivePlayerWeapon(playerid312000); 
        
SetPlayerArmour(playerid80); 
        return 
1
    } 
    if(
strcmp(cmd"/kitvipb"true) == 0
    { 
        if(
VIP[playerid] < 1) return SendClientMessage(playerid, -1"Vocк nгo й Vip Bronze."); 
        
GivePlayerWeapon(playerid241000); 
        
GivePlayerWeapon(playerid291000); 
        
GivePlayerWeapon(playerid311000); 
        
SetPlayerArmour(playerid70); 
        return 
1
    } 
    if(
strcmp(cmd"/vips"true) == 0
    { 
        new 
str[128], n[24]; 
        for(new 
0MAX_PLAYERS++) 
        { 
            
GetPlayerName(insizeof(n)); 
            if(
VIP[i] == 1) { format(strsizeof(str), " » %s - {00FF0C}Vip Bronze"n); } 
            else if(
VIP[i] == 2) { format(strsizeof(str), " » %s - {303AFF}Vip Prata"n); } 
            else if(
VIP[i] == 2) { format(strsizeof(str), " » %s - {FFFE10}Vip Ouro"n); } 
            
SendClientMessage(playerid, -1str); 
        } 
        return 
1
    } 
    if(
strcmp(cmd"/chatvip"true) == 0
        { 
        if(
VIP[playerid] < 1) return SendClientMessage(playerid, -1"Vocк nгo й Vip."); 
        new 
string[256], n[24];  
        new 
length strlen(cmdtext);  
        while ((
idx length) && (cmdtext[idx] <= ' '))  
        {  
            
idx++;  
        }  
        new 
offset idx;  
        new 
result[64];  
        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))  
        {  
            
result[idx offset] = cmdtext[idx];  
            
idx++;  
        }  
        
result[idx offset] = EOS;  
        if(!
strlen(result)) return SendClientMessage(playerid, -1"USO: /chatvip [TEXTO]");  
        
GetPlayerName(playeridnsizeof(n));  
        for(new 
0MAX_PLAYERS++)  
        {  
            if(
VIP[i] > 0)  
            {  
                
format(stringsizeof(string), "{FCF405}[CHAT VIP]{FFFFFF} %s: %s"nresult);  
                  
SendClientMessage(i, -1string);  
            }  
        } 
        return 
1
    } 
    if(
strcmp(cmd"/darvip"true) == 0
    { 
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"Vocк nгo estб logado na RCON."); 
        new 
tmp[256], idlvlstr[128], n[24], n2[24]; 
        
tmp strtok(cmdtextidx); 
        if(!
strlen(tmp)) return SendClientMessage(playerid, -1"USO: /darvip [ID] [LEVEL]"); 
        
id strval(tmp); 
        
tmp strtok(cmdtextidx); 
        if(!
strlen(tmp)) return SendClientMessage(playerid, -1"USO: /darvip [ID] [LEVEL]"); 
        
lvl strval(tmp); 
        
VIP[id] = lvl
        
GetPlayerName(playeridn24); 
        
GetPlayerName(idn224); 
        
format(strsizeof(str), "O ADMIN %s te deu VIP level %d."nlvl); 
        
SendClientMessage(id, -1str); 
        
format(strsizeof(str), "Vocк deu VIP level %d para o jogador %s."lvln2); 
        
SendClientMessage(playerid, -1str); 
        return 
1
    } 
    return 
0

[/PHP][/PHP]
Reply
#2

PHP код:
#include <a_samp>
#include <Dini>
new VIP[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    new 
file[30], n[24];
    
GetPlayerName(playeridn24);
    
format(file30"%s.txt"n);
    if(
fexist(file)) { VIP[playerid] = dini_Int(file"VIP"); }
    else
    {
        
dini_Create(file);
        
VIP[playerid] = 0;
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
file[30], n[24];
    
GetPlayerName(playeridn24);
    
format(file30"%s.txt"n);
    
dini_IntSet(file"VIP"VIP[playerid]);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[256], idx;
    
cmd strtok(cmdtextidx);
    if(
strcmp(cmd"/kitvipo"true) == 0)
    {
        if(
VIP[playerid] < 3) return SendClientMessage(playerid, -1"Vocк nгo й Vip Ouro.");
        
GivePlayerWeapon(playerid243000);
        
GivePlayerWeapon(playerid293000);
        
GivePlayerWeapon(playerid313000);
        
SetPlayerArmour(playerid90);
        return 
1;
    }
    if(
strcmp(cmd"/kitvipp"true) == 0)
    {
        if(
VIP[playerid] < 2) return SendClientMessage(playerid, -1"Vocк nгo й Vip Prata.");
        
GivePlayerWeapon(playerid242000);
        
GivePlayerWeapon(playerid292000);
        
GivePlayerWeapon(playerid312000);
        
SetPlayerArmour(playerid80);
        return 
1;
    }
    if(
strcmp(cmd"/kitvipb"true) == 0)
    {
        if(
VIP[playerid] < 1) return SendClientMessage(playerid, -1"Vocк nгo й Vip Bronze.");
        
GivePlayerWeapon(playerid241000);
        
GivePlayerWeapon(playerid291000);
        
GivePlayerWeapon(playerid311000);
        
SetPlayerArmour(playerid70);
        return 
1;
    }
    if(
strcmp(cmd"/vips"true) == 0)
    {
        new 
str[128], n[24];
        for(new 
0MAX_PLAYERS++)
        {
            
GetPlayerName(insizeof(n));
            if(
VIP[i] == 1) { format(strsizeof(str), " » %s - {00FF0C}Vip Bronze"n); }
            else if(
VIP[i] == 2) { format(strsizeof(str), " » %s - {303AFF}Vip Prata"n); }
            else if(
VIP[i] == 2) { format(strsizeof(str), " » %s - {FFFE10}Vip Ouro"n); }
            
SendClientMessage(playerid, -1str);
        }
        return 
1;
    }
    if(
strcmp(cmd"/chatvip"true) == 0)
        {
        if(
VIP[playerid] < 1) return SendClientMessage(playerid, -1"Vocк nгo й Vip.");
        new 
string[256], n[24];
        new 
length strlen(cmdtext);
        while ((
idx length) && (cmdtext[idx] <= ' '))
        {
            
idx++;
        }
        new 
offset idx;
        new 
result[64];
        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
        {
            
result[idx offset] = cmdtext[idx];
            
idx++;
        }
        
result[idx offset] = EOS;
        if(!
strlen(result)) return SendClientMessage(playerid, -1"USO: /chatvip [TEXTO]");
        
GetPlayerName(playeridnsizeof(n));
        for(new 
0MAX_PLAYERS++)
        {
            if(
VIP[i] > 0)
            {
                
format(stringsizeof(string), "{FCF405}[CHAT VIP]{FFFFFF} %s: %s"nresult);
                  
SendClientMessage(i, -1string);
            }
        }
        return 
1;
    }
    if(
strcmp(cmd"/darvip"true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"Vocк nгo estб logado na RCON.");
        new 
tmp[256], idlvlstr[128], n[24], n2[24];
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp)) return SendClientMessage(playerid, -1"USO: /darvip [ID] [LEVEL]");
        
id strval(tmp);
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp)) return SendClientMessage(playerid, -1"USO: /darvip [ID] [LEVEL]");
        
lvl strval(tmp);
        
VIP[id] = lvl;
        
GetPlayerName(playeridn24);
        
GetPlayerName(idn224);
        
format(strsizeof(str), "O ADMIN %s te deu VIP level %d."nlvl);
        
SendClientMessage(id, -1str);
        
format(strsizeof(str), "Vocк deu VIP level %d para o jogador %s."lvln2);
        
SendClientMessage(playerid, -1str);
        return 
1;
    }
    return 
0;

Reply
#3

6 Erros agr '-'


PHP код:
C:\Users\Thiago Miranda\Desktop\FSVIP.pwn(30) : error 017undefined symbol "strtok"
C:\Users\Thiago Miranda\Desktop\FSVIP.pwn(30) : error 033: array must be indexed (variable "cmd")
C:\Users\Thiago Miranda\Desktop\FSVIP.pwn(95) : warning 217loose indentation
C
:\Users\Thiago Miranda\Desktop\FSVIP.pwn(104) : error 017undefined symbol "strtok"
C:\Users\Thiago Miranda\Desktop\FSVIP.pwn(104) : error 033: array must be indexed (variable "tmp")
C:\Users\Thiago Miranda\Desktop\FSVIP.pwn(107) : error 017undefined symbol "strtok"
C:\Users\Thiago Miranda\Desktop\FSVIP.pwn(107) : error 033: array must be indexed (variable "tmp")
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
6 Errors

Reply
#4

Cara, quer que eu faзa um sistema vip pra vocк?
Reply
#5

por favor ;s
Reply
#6

Basta colocar isto no final do GM:

PHP код:
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;

Reply
#7

new tmp = strtok(cmdtext, idx);
Reply
#8

tipo eu coloquei o que o shadow me passo ai deu warning sу que passo pra amx '-' sera que da algum erro la dentro ?
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)