The command does not work when I use
#1

Staff This is the command of weapons for the event most when I use it is not giving weapons
Код:
	if(strcmp(cmdtext, "/armarevento", true) == 0){
	if(!organizador[playerid] || pAdmin[playerid] < 5)return SendClientMessage(playerid,0xFF0000FF,"| INFO | Apenas Organizadores de Evento e Admins Pode Usar Esse Comando");
	if(!strlen(tmp))return SendClientMessage(playerid,0xFF0000FF,"Uso /armarevento [arma id] [balas]");
	new arma,balas;
	arma = strval(tmp);
	if(arma > 46)return SendClientMessage(playerid,0xFF0000FF,"| ERRO | Arma invalida");
	tmp = strtok(cmdtext,idx);
	if(!strlen(tmp))return SendClientMessage(playerid,0xFF0000FF,"Uso /armarevento [arma id] [balas]");
	balas = strval(tmp);
	for(new i, x = GetMaxPlayers(); i != x; ++i)
	{
	if(IsPlayerConnected(i) && InEvento[i] == 1)
	{
	GivePlayerWeapon(i,arma,balas);
	}
	}
	return 1;
	}
Reply
#2

-deleted-
Reply
#3

There's nothing in the pastebin
Reply
#4

Try this one
PHP код:
if(strcmp(cmdtext"/armarevento"true) == 0){
    if(!
organizador[playerid] || pAdmin[playerid] < 5)return SendClientMessage(playerid,0xFF0000FF,"| INFO | Apenas Organizadores de Evento e Admins Pode Usar Esse Comando");
    if(!
strlen(tmp))return SendClientMessage(playerid,0xFF0000FF,"Uso /armarevento [arma id] [balas]");
    new 
arma,balas;
    
arma strval(tmp);
    if(
arma 46)return SendClientMessage(playerid,0xFF0000FF,"| ERRO | Arma invalida");
    
tmp strtok(cmdtext,idx);
    if(!
strlen(tmp))return SendClientMessage(playerid,0xFF0000FF,"Uso /armarevento [arma id] [balas]");
    
balas strval(tmp);
    for(new 
0MAX_PLAYERSi++)
    {
    if(
IsPlayerConnected(i) && InEvento[i] == 1)
    {
    
GivePlayerWeapon(i,arma,balas);
    }
    }
    return 
1;
    } 
Reply
#5

Are you serious: strok and OnPlayerCommandText? Dude, command processors and sscanf exist.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)