DCMD command not working at all.
#5

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
It does nothing right at the start, if I'm lower then Level 2 it doesn't send me the return message for that.
Well for one thing that color doesn't look very valid, -1? What color are you intending it to be? It should be in hex format, but all I see is a negative integer, which seems a little odd, I don't know what kind of results that would turn up, but I would suggest using the function as it's intended to be used!

Anyway, I'm pretty sure it'll do something if it's called, so lets add some prints to debug it like I stated earlier, I'll help you add them:

pawn Код:
dcmd_robbank(playerid, params[])
{
    print("Success 1");
    if(PlayerInfo[playerid][pLevel] < 2) return SendClientMessage(playerid, -1, "You need to be at least Level 3!");
    print("Success 2");    
    if(!IsPlayerInRangeOfPoint(playerid, 2, 345.585968, 112.513107, 1008.184448) return SendClientMessage(playerid, -1, "You're not at the Robbing Point!");
    print("Success 3");
    if(IsACop(playerid)) return SendClientMessage(playerid, -1, "Cops cannot rob the bank!");
    new Cops = 0;
    print("Success 4");
    for(new i = 0; i < MAX_PLAYERS; i++)
        if(IsACop(i)) Cops += 1;
    print("Success 5");
    if(!(Cops >= 2))
    {
        print("Success 6");
        SendClientMessage(playerid,COLOR_GREY,"There must be at least 2 Law Enforcement Officials online.");
        return 1;
    }
    print("Success 7");
    //new sendername[MAX_PLAYER_NAME]; - Pointless? Never used in this snippet!
    //GetPlayerName(playerid, sendername, sizeof(sendername)); - Pointless? Never used in this snippet!
    SendClientMessageToAll(COLOR_LIGHTBLUE, "The Los Santos City bank is being robbed!");
    return 1;
}
Give that a run and tell me exactly what it prints out (I've also cleaned up your code a little as it was kind of hard to read!)
Reply


Messages In This Thread
DCMD command not working at all. - by Jack_Leslie - 23.07.2011, 05:04
Re: ZCMD command not working at all. - by Kitten - 23.07.2011, 05:05
Re: ZCMD command not working at all. - by JaTochNietDan - 23.07.2011, 05:06
Re: ZCMD command not working at all. - by Jack_Leslie - 23.07.2011, 05:07
Re: ZCMD command not working at all. - by JaTochNietDan - 23.07.2011, 05:12
Re: ZCMD command not working at all. - by Jack_Leslie - 23.07.2011, 05:16
Re: DCMD command not working at all. - by JaTochNietDan - 23.07.2011, 05:19
Re: DCMD command not working at all. - by Jack_Leslie - 23.07.2011, 05:21
Re: DCMD command not working at all. - by JaTochNietDan - 23.07.2011, 05:22
Re: DCMD command not working at all. - by Jack_Leslie - 23.07.2011, 05:24

Forum Jump:


Users browsing this thread: 1 Guest(s)