Ajudinha com comando /arrastar
#1

Tem alguma coisa de errado neste cуdigo?

sempre que vou tentar compilar ele o pawno para de funcionar

pawn Код:
if(strcmp(cmd, "/arrastar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pTanabolisante] > 0) return SendClientMessage(playerid,COLOR_GREY,"[POLICIA] Vocк estб suspenso!");
            if(!IsACop(playerid))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um Cop!");
                return 0x01;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, " [POLICIA]: /arrastar [IdPLayer/ParteDoNome]");
                return 0x01;
            }
            new newcar = GetPlayerVehicleID(playerid);
            new playa;
            playa = ReturnUser(tmp);
            if(IsACopCar(newcar) || IsNgCar(newcar) || IsAnFbiCar(newcar))
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        new Float:x, Float:y, Float:z;
                        GetPlayerPos(playa,x,y,z);
                        if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z))
                        {
                            PutPlayerInVehicle(playa,newcar,2);
                            GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                            format(string, sizeof(string), "[POLICIA] %s colocou %s no camburгo.", sendername ,giveplayer);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            new y1, m, d;
                            new h,mi,s;
                            getdate(y1,m,d);
                            gettime(h,mi,s);
                            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /arrastar %s",d,m,y1,h,mi,s,sendername,giveplayer);
                            CommandLog(string);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "Jogador nгo estб prуximo a vocк.");
                        }
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб em um veнculo policial!");
            }
        }
        return 0x01;
    }
Me ajudem..
Reply
#2

Nгo sei se vai funcionar tenta ae
PHP код:
    if(strcmp(cmd"/arrastar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
         {
            if(
PlayerInfo[playerid][pTanabolisante] > 0) return SendClientMessage(playerid,COLOR_GREY,"[POLICIA] Vocк estб suspenso!");
            if(!
IsACop(playerid))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo й um Cop!");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2" [POLICIA]: /arrastar [IdPLayer/ParteDoNome]");
                return 
1;
            }
            new 
newcar GetPlayerVehicleID(playerid);
            new 
playa;
            
playa ReturnUser(tmp);
            if(
IsACopCar(newcar) || IsNgCar(newcar) || IsAnFbiCar(newcar))
            {
                if(
IsPlayerConnected(playa))
                {
                    if(
playa != INVALID_PLAYER_ID)
                    {
                        new 
Float:xFloat:yFloat:z;
                        
GetPlayerPos(playa,x,y,z);
                        if(
IsPlayerInRangeOfPoint(playerid5xyz))
                        {
                            
PutPlayerInVehicle(playa,newcar,2);
                            
GetPlayerName(playagiveplayersizeof(giveplayer));
                            
format(stringsizeof(string), "[POLICIA] %s colocou %s no camburгo."sendername ,giveplayer);
                            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            new 
y1md;
                            new 
h,mi,s;
                            
getdate(y1,m,d);
                            
gettime(h,mi,s);
                            
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /arrastar %s",d,m,y1,h,mi,s,sendername,giveplayer);
                            
CommandLog(string);
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"Jogador nгo estб prуximo a vocк.");
                        }
                    }
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo estб em um veнculo policial!");
            }
        }
        return 
1;
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)