Help with setting a limit
#2

pawn Код:
//global variables
    new bool:Blocked[MAX_PLAYERS];
    new roadblock[MAX_PLAYERS];

    //commands
    if (strcmp(cmd,"/roadblock",true) == 0)
    {
        if(!Blocked[playerid])
        {
            new Float:X,Float:Y,Float:Z,Float:A;
            GetPlayerPos(playerid, X, Y, Z);
            GetPlayerFacingAngle(playerid,A);
            roadblock[playerid] = CreateObject(978, X, Y, Z, 0.0, 0.0, A);
            Block[playerid] = true;
            return 1;
        }
        else return SendClientMessage(playerid, -1, "You already create a road block...delete first!");
    }
    if (strcmp(cmd,"/deleteblock",true) == 0)
    {
        if(Blocked[playerid])
        {
            DestroyObject(roadblock[playerid);
            Blocked[playerid] = false;
            return 1;
        }
        else return SendClientMessage(playerid, -1, "You dont create any road block!");
    }
Reply


Messages In This Thread
Help with setting a limit - by Mark_Niko - 06.10.2011, 16:54
Re: Help with setting a limit - by Pharrel - 06.10.2011, 17:06
Re: Help with setting a limit - by Mark_Niko - 06.10.2011, 17:13

Forum Jump:


Users browsing this thread: 2 Guest(s)