/slap and /spec command to SAGC GM
#1

Ok i tried,and i failed....3 days now reading tuts...and nothing...can someone help me PLS doing these 2 commands?
Reply
#2

Post the code you've tried, you can learn a lot more when you see the things you do wrong instead of seeing other people doing it for you and you just copy-paste it in your script

Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 5 seconds.

>.<
Reply
#3

Quote:
Originally Posted by Think
Посмотреть сообщение
Post the code you've tried, you can learn a lot more when you see the things you do wrong instead of seeing other people doing it for you and you just copy-paste it in your script

>.<
well even with copy paste i failed xD i tried to check commands from others GMS and admin FSs and then modifie,but still...no warnings or errors...but not working xD






pawn Код:
if(strcmp(cmd, "/slap", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_RED, "USAGE: /slap [playerid/PartOfName]");
                return 1;
            }
            new playa;
            new Float:slx, Float:sly, Float:slz;
            playa = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 1  || IsPlayerAdmin(playerid))
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        new targetlevel = PlayerInfo[playa][pAdmin];
                        new playerlevel = PlayerInfo[playerid][pAdmin];
                        if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* You can not slap People that is higher Than You!");
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerPos(playa, slx, sly, slz);
                        PlayerPlaySound(playa, 1190, slx, sly, slz+8);
                        new y, m, d;
                        new h,mi,s;
                        getdate(y,m,d);
                        gettime(h,mi,s);
                        format(string, sizeof(string), "[Info:] You slaped %s",GetPlayerNameEx(playa));
                        SendClientMessage(playerid,COLOR_ADMINCMD,string);
                        format(string, sizeof(string), "[Info:] You have been slapped by %s",GetPlayerNameEx(playerid));
                        SendClientMessage(playa,COLOR_WHITE,string);
                        format(string, sizeof(string), "[Info:] %s have been slapped by %s",GetPlayerNameEx(playa),GetPlayerNameEx(playerid)); //editbs
                        SendClientMessageToAll(COLOR_ADMINDUTY,string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "** you are not authorized to use that command!");
            }
        }
        return 1;
    }
pawn Код:
}

    if(strcmp(cmd, "/spec", true) == 0 && PlayerInfo[playerid][pAdmin] >= 101) {
        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp)) {
            SendClientMessage(playerid, COLOR_RED, "USAGE: /spec [playerid]");
            return 1;
        }
        specplayerid = strval(tmp);

        if(!IsPlayerConnected(specplayerid)) {
            SendClientMessage(playerid, COLOR_RED, "    That player isn't active.");
            return 1;
        }

        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, specplayerid);
        SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
        gSpectateID[playerid] = specplayerid;
        gSpectateType[playerid] = SPEC_TYPE_PLAYER;

        return 1;
    }


    if(strcmp(cmd, "/specvec", true) == 0 && PlayerInfo[playerid][pAdmin] >= 101) {
        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp)) {
            SendClientMessage(playerid, COLOR_RED, "USAGE: /specvec [vehicleid]");
            return 1;
        }
        specvehicleid = strval(tmp);

        if(specvehicleid < MAX_VEHICLES) {
            TogglePlayerSpectating(playerid, 1);
            PlayerSpectateVehicle(playerid, specvehicleid);
            gSpectateID[playerid] = specvehicleid;
            gSpectateType[playerid] = SPEC_TYPE_VEHICLE;
        }
        return 1;
    }


    if(strcmp(cmd, "/specoff", true) == 0 && PlayerInfo[playerid][pAdmin] >= 101)
    {
        TogglePlayerSpectating(playerid, 0);
        gSpectateID[playerid] = INVALID_PLAYER_ID;
        gSpectateType[playerid] = SPEC_TYPE_NONE;
        return 1;
    }

    if (strcmp(cmdtext, "/flip", true) == 0)
    {
        if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][pAdmin] < 103)
        {
            SendClientMessage(playerid,COLOR_RED,"ADMCENTER: You are not authorized to use that command!");
            return 1;
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
            new flipid, Float:vehx, Float:vehy, Float:vehz;
            GetPlayerPos(playerid, vehx, vehy, vehz);
            flipid = GetPlayerVehicleID(playerid);
            SetVehiclePos(flipid, vehx, vehy, vehz);
            SetVehicleZAngle(flipid, 0);
            SendClientMessage(playerid,COLOR_RED,"ADMCENTER: You placed your vehicle on the wheels");
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"ADMCENTER: You must be in vehicle");
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)