check id
#1

in OnPlayerEnterCheckpoint how do i do something like

if(checkpointid == englandcp)
{


p.s im using streamer for cps
Reply
#2

It's OnPlayerEnterDynamicCheckpoint
Reply
#3

pawn Код:
public OnPlayerEnterDynamicCheckpoint(playerid, streamid)
{
   if(streamid == englandcp)
   {
Too late..
Reply
#4

ok thanks
i get an error that englandcp is undefined

pawn Код:
//=======================[INCLUDES]==========================================================//
#include <a_samp>
#include <zcmd>
#include <streamer>
#include <sscanf2>
#include <dini>
#include <foreach>
//========================[COLOUR DEFINES]===========================================================//
#define COLOR_ORANGE 0xFF8000FF
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BLUE1 0x0066FFFF
#define COLOR_RED 0xAA3333AA
#define COLOR_RED2 0xFF0000FF
#define COLOR_REALRED 0xFF0606FF
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_VIP 0xC93CCE00
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_BLACK 0x000000AA
//=======================[DIALOG DEFINES]==========================================================//
#define DIALOG_ESHOP 1
#define DIALOG_RSHOP 2
//===================[TEAM DEFINES]===========================================================//
#define England 1
#define Russia 2
//=========================[FORWADS]=======================================================//
forward OnPlayerEnterDynamicArea(playerid, areaid);
//=========================[BOOLS]===========================================================//
//============================[STOCKS]======================================================//
stock PlayerName(playerid) {
    new pName[24];
    GetPlayerName(playerid,pName,24);
    return pName;
}
stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}
//=========================================================================================//
new englandzone;
new russiazone;
main()
{
    print("\n*^$%Ј!<>,.?zz\\\\\\\\\\\\\\\\");
    print(" FatTDM By Thefatshizms *_* :D");
    print("!Ј$%^&*_+<>?@~:{}|\\\\\\\\\\\\\n");
}


public OnGameModeInit()
{
    SetGameModeText("FatTDM");
    //==============================[CLASES]==================================================//
    AddPlayerClass(121,226.7424,1931.4076,17.6406,265.3649,24,1000,31,1000,26,1000); // englandpos1
    AddPlayerClass(179,204.5247,1869.6681,13.1406,274.2833,24,1000,31,1000,26,1000); // englandpos2
    AddPlayerClass(217,209.3599,1855.4443,20.2765,356.2324,24,1000,31,1000,26,1000); // englandpos3
    AddPlayerClass(101,-347.0208,1570.8115,75.9954,179.4697,24,1000,31,1000,26,1000); // russiapos1
    AddPlayerClass(73,-309.2180,1537.6707,75.5625,133.7227,24,1000,31,1000,26,1000); // russiapos2
    //========================================================================================//
    englandzone = CreateDynamicRectangle(284.8186, 1805.9808, 97.5450, 1940.9124, -1, -1, -1);
    russiazone = CreateDynamicRectangle(-202.8799, 1385.0337, -383.7028, 1631.0679, -1, -1, -1);
    return 1;
}

enum gPInfo
{
    Padmin,
    Preg,
    Ploged,
    Banned,
    Level,
    Reason,
}
new PInfo[MAX_PLAYERS][gPInfo];

public OnGameModeExit()
{
    return 1;
}
new Team[MAX_PLAYERS] = -1;
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1220.0737,-6.3703,1001.3281);
    SetPlayerInterior(playerid,2);
    SetPlayerFacingAngle(playerid,92.3402);
    SetPlayerCameraPos(playerid,1214.3527,-6.4071,1001.3290);
    SetPlayerCameraLookAt(playerid, 1220.0737,-6.3703,1000.3281);
    switch(classid)
    {
        case 0:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~P~Croatia", 1000, 6);
            Team[playerid] = 2;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~P~Croatia", 1000, 6);
            Team[playerid] = 2;
        }
    }
    return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~p~Croatia", 1000, 6);
            Team[playerid] = 2;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~p~Croatia", 1000, 6);
            Team[playerid] = 2;
        }
    }
    return 1;
}
public OnPlayerConnect(playerid)
{
    new string[128];
    format(string, sizeof(string), "%s[%d] Has joined FatTDM", PlayerName(playerid), playerid);
    SendClientMessageToAll(-1, string);
    PInfo[playerid][Padmin] = 0;

    new name[MAX_PLAYERS], file[256];
    GetPlayerName(playerid,name,sizeof(name));
    format(file,sizeof(file),"FatAdmin/Users/%s.ini",name);

    if(dini_Exists(file))
    {
        SendClientMessage(playerid, -1, "Your account has been loaded you mus login or be kicked /login");
        PInfo[playerid][Preg] =1;
        PInfo[playerid][Ploged] =0;
        PInfo[playerid][Banned] =0;
        return 1;
    }
    if(!dini_Exists(file))
    {
        SendClientMessage(playerid, -1, "You need to register or be kicked /register");
        PInfo[playerid][Preg] =0;
        PInfo[playerid][Ploged] =0;
        PInfo[playerid][Banned] =0;
        return 1;
    }
    if(dini_Exists(file))
    {
            SendClientMessage(playerid, COLOR_RED, "you are banned from this server goodbye");
            PInfo[playerid][Preg] =0;
            PInfo[playerid][Ploged] =0;
            PInfo[playerid][Banned] =1;
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file),"FatAdmin/Users/%s.ini,name");
    PInfo[playerid][Ploged] =0;
    if(dini_Exists(file))
    {
        dini_IntSet(file,"PLoged",0);
        return 1;
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new englandcp;
    new russiancp;
    SetPlayerInterior(playerid, 0);
    englandcp = CreateDynamicCP(247.9255,1859.3064,14.0840, 2, -1, -1, -1);
    russiancp = CreateDynamicCP(-340.0471,1543.2358,75.5625, 2, -1, -1, -1);
    if (PInfo[playerid][Ploged] == 0) return Kick(playerid);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); //If not invalid killerid (not a vehicle, etcetra), gets current score and adds one to the killer.
    GivePlayerMoney(playerid, random(30000 - 10000) + 10000);//Randomizes the amount of cash the person gets, 20000 - 30000
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterDynamicCheckpoint(playerid, streamid)
{
   if(streamid == englandcp)
   {
        ShowPlayerDialog(playerid, DIALOG_ESHOP, DIALOG_STYLE_LIST, "England Shop", "full health($500)\nfull armor($500)\nGodMode($500000)\nminigun($100000)\nm4($2000)", "Buy", "cancel");
        }
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_ESHOP) // Making sure its that dialog
    {
       
        if(response) // checking to see if they press the first button, in this case "Ok"
        {
            switch(listitem) // typically, if the beginning word is highlited in blue, you dont put a ';' at the end ok
            {
                case 0:
                {
                    if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
                    GivePlayerMoney(playerid, -500);
                    SendClientMessage(playerid, COLOR_RED, "you have bought health");
                    SetPlayerHealth(playerid, 100.0);
                }
                case 1:
                {
                    if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
                    GivePlayerMoney(playerid, -500);
                    SendClientMessage(playerid, COLOR_RED, "You have bought armour");
                    SetPlayerArmour(playerid, 100.0);
                }
                case 2:
                {
                    new string[128];
                    if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash you need $500000");
                    GivePlayerMoney(playerid, -500000);
                    SendClientMessage(playerid, COLOR_RED, "You have bought GodMode");
                    SetPlayerHealth(playerid, 10000000.0);
                    SetPlayerColor(playerid, COLOR_BLACK);
                    format(string, sizeof(string),"%s has nnow got godmode!",PlayerName(playerid));
                   
                }
                case 3:
                {
                    if(GetPlayerMoney(playerid) < 100000) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
                    GivePlayerMoney(playerid, -100000);
                    SendClientMessage(playerid, COLOR_RED, "You have bought a minigun");
                    GivePlayerWeapon(playerid, 38, 650);
                }
                case 4:
                {
                    if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid, COLOR_RED, "You have bought a m4");
                    GivePlayerWeapon(playerid, 31, 650);
                }
            }
        }
    }
    return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
//=============================[COMMANDS]============================================//
CMD:pm(playerid, params[])
{
    new string[50];
    new sent[128];
    new id;
    if(sscanf(params,"us[50]",id,string)) return SendClientMessage(playerid, COLOR_PURPLE, "USGAE: /pm <id> <message>");
    format(string, sizeof(string),"**PM From %s**: {690069}%s", PlayerName(playerid), string);
    format(sent, sizeof(sent),"Message: Sent to %s", PlayerName(id));
    SendClientMessage(playerid, COLOR_LIGHTGREEN, sent);
    SendClientMessage(id, COLOR_PURPLE, string);
    GameTextForPlayer(playerid, "~r~Message ~b~Sent", 2000, 1);
    GameTextForPlayer(id, "~r~New Message ~b~Recived", 2000, 1);
    PlayerPlaySound(playerid, 1057, 0, 0, 0);
    PlayerPlaySound(id, 1057, 0, 0, 0);
    return 1;
}
CMD:reg(playerid, params[])
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file),"FatAdmin/Users/%s.ini",name);
    if(dini_Exists(file)) return SendClientMessage(playerid, -1, "You have already registered!");
    if(PInfo[playerid][Preg] == 1) return SendClientMessage(playerid, -1, "you have registered!");
    if(PInfo[playerid][Ploged] == 1) return SendClientMessage(playerid, -1, "you have already loged in");
    if(strlen(params))
    {
        if(!dini_Exists(file))
        {
            dini_Create(file);
            dini_Set(file,"password", params);
            dini_IntSet(file,"Preg", 0);
            dini_IntSet(file,"PLoged",0);
            dini_IntSet(file,"Padmin",0);
            PInfo[playerid][Preg] = 1;
            return SendClientMessage(playerid, -1, "congrats you registered");
        }
        else
        {
            SendClientMessage(playerid, -1, "USAGE: /reg <password>");
            return 1;
        }
    }
    return 1;
}
CMD:login(playerid, params[])
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid,name, sizeof(name));
    format(file, sizeof(file), "FatAdmin/Users/%s.ini",name);
    if(!dini_Exists(file)) return SendClientMessage(playerid,-1,"You are not registered! Please /register");
    if(PInfo[playerid][Ploged] == 1) return SendClientMessage(playerid,-1,"You are already logged in!");
    if(PInfo[playerid][Preg] == 0) return SendClientMessage(playerid,-1,"You are not registered! Please /register");
    if(strlen(params))
    {
        new pass[256];
        pass = dini_Get(file, "password");
        if(dini_Exists(file))
        {
            if(strcmp(params,pass,false) != 0)
            {
                SendClientMessage(playerid,-1,"Wrong Password!");
            }
            else
            {
                dini_IntSet(file,"Logged",1);
                PInfo[playerid][Ploged] = 1;
                PInfo[playerid][Level] = dini_Int(file,"Level");
                SendClientMessage(playerid,-1,"You have now logged in!");
                return 1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid,-1,"USAGE: /login <Password>");
        return 1;
    }
    return 1;
}
CMD:w(playerid, params[])
{
    new message[50];
    if(sscanf(params,"s[50]",message)) return SendClientMessage(playerid, -1, "USAGE: /w [text]");
    format(message, sizeof(message), "%s: %s", PlayerName(playerid), message);
    ProxDetector(5, playerid, message, -1);
    SetPlayerChatBubble(playerid, message, -1, 100.0, 10000);
    return 1;
}

//==========================[ADMIN SYSTEM]=========================================//
CMD:achat(playerid, params[])
{
    new msg[50];
    if(sscanf(params,"s[50]",msg)) return SendClientMessage(playerid, -1, "USAGE: /achat <message>");
    format(msg, sizeof(msg),"[ADMIN]:  %s",msg);
    SendClientMessageToAll(COLOR_BLUE1, msg);
    return 1;
}
CMD:fchat(playerid, params[])
{
    new id;
    new msg[50];
    if(sscanf(params,"us[50]",id,msg)) return SendClientMessage(playerid, -1, "USAGE: /fchat <id> <message>");
    format(msg, sizeof(msg),"%s %s",PlayerName(id),msg);
    SendClientMessageToAll(-1, msg);
    return 1;
}
CMD:setlvl(playerid, params[])
{
    new id;
    new lvl;
    new name[MAX_PLAYER_NAME];
    new file[128];
    new string[128];
    new string2[128];
    if(sscanf(params,"ui",id,lvl)) return SendClientMessage(playerid, -1, "USAGE: /setlvl <id> <lvl>");
    GetPlayerName(id,name,sizeof(name));
    format(file, sizeof(file),"FatAdmin/Users/%s.ini",name);
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not an RCON admin!");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"invaild id");
    PInfo[id][Padmin] = lvl;
    dini_IntSet(file,"Padmin", lvl);
    format(string2, sizeof(string),"you have been given a admin lvl of %d by %s", lvl, name);
    SendClientMessage(id, -1, string2);
    format(string, sizeof(string),"you have set %s to admin level %d", name, lvl);
    SendClientMessage(playerid, -1,string);
    return 1;
}
CMD:kick(playerid, params[]) {
    new ID, reason[24], string[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"us[24]",ID,reason)) return SendClientMessage(playerid,0xA70000FF,"Syntax: /Kick [ID] [Reason].");
    format(string,sizeof(string),"You've kicked %s for reason: %s.",PlayerName(ID),reason);
    SendClientMessage(playerid,0xFFFFFFFF,string);
    format(string,sizeof(string),"You've been kicked by %s for reason: %s.",PlayerName(playerid),reason);
    SendClientMessage(ID,0xFFFFFFFF,string);
    Kick(ID);
    return true;
}
CMD:setscore(playerid, params[])
{
    new id;
    new score;
    new msg[128];
    new msg2[128];
    if(PInfo[playerid][Padmin] == 3) return true;
    else if(sscanf(params,"ui", id, score)) return SendClientMessage(playerid, -1, "USAGE: /setscore <id> <score>");
    SetPlayerScore(id,score);
    format(msg, sizeof(msg), "you have set %s score to %d", PlayerName(id), score);
    format(msg2, sizeof(msg), "your score has been set by %s to score %d", PlayerName(playerid), score);
    SendClientMessage(playerid, -1, msg);
    SendClientMessage(id, -1, msg2);
    PlayerPlaySound(id, 5450, 0, 0, 0);
    PlayerPlaySound(playerid, 5201, 0, 0, 0);
    return 1;
}
CMD:givewep(playerid, params[])
{
    new id;
    new gunid;
    new wepstring[128];
    new wepstring2[128];
    if(PInfo[playerid][Padmin] == 3) return true;
    else if(sscanf(params,"ui",id,gunid)) return SendClientMessage(playerid, -1, "usage: /givewep <id> <wepid>");
    GivePlayerWeapon(id, gunid, 500);
    format(wepstring, sizeof(wepstring), "you have given %s a gun", PlayerName(id));
    format(wepstring2, sizeof(wepstring2), "you have been given a gun by %s", PlayerName(playerid));
    SendClientMessage(playerid, -1, wepstring);
    SendClientMessage(id, -1, wepstring2);
    return 1;
}
CMD:explode(playerid, params[])
{
    new id;
    new allstring[128];
    new mestring[128];
    new youstring[128];
    new Float:X, Float:Y, Float:Z;
    if(PInfo[playerid][Padmin] == 3) return true;
    else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /explode [id]");
    GetPlayerPos(id, X, Y, Z);
    CreateExplosion(X, Y, Z, 0, 1);
    format(allstring, sizeof(allstring), "%s has exploded %s", PlayerName(playerid), PlayerName(id));
    format(mestring, sizeof(mestring), "you have exploded %s", PlayerName(id));
    format(youstring, sizeof(youstring), "you have been exploded by %s", PlayerName(playerid));
    SendClientMessageToAll(-1, allstring);
    SendClientMessage(playerid, -1, mestring);
    SendClientMessage(id, -1, youstring);
    return 1;
}
CMD:ann(playerid, params[])
{
    new text[50];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"s[50]",text)) return SendClientMessage(playerid, -1, "USAGE: /ann [text]");
    GameTextForAll(text, 10000, 6);
    return 1;
}
CMD:gethere(playerid, params[])
{
    new id;
    new Float:X, Float:Y, Float:Z;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /gethere [id]");
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(id, X, Y, Z);
    format(string, sizeof(string), "you have teleported %s to your position", PlayerName(id));
    format(string2, sizeof(string2), "you have been teleported to %s's position", PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:freeze(playerid, params[])
{
    new id;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /freeze [id]");
    TogglePlayerControllable(id, 0);
    format(string, sizeof(string), "you have frozen %s", PlayerName(id));
    format(string2, sizeof(string2), "you have been frozen by %s", PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:unfreeze(playerid, params[])
{
    new id;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /unfreeze [id]");
    TogglePlayerControllable(id, 1);
    format(string, sizeof(string), "you have unfrozen %s", PlayerName(id));
    format(string2, sizeof(string2), "you have been unfrozen by %s", PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:setskin(playerid, params[])
{
    new id;
    new skinid;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"ui",id,skinid)) return SendClientMessage(playerid, -1, "USAGE: /setskin [id] [skinid]");
    SetPlayerSkin(id, skinid);
    format(string, sizeof(string), "you have made %s skin id %d",PlayerName(id),skinid);
    format(string2, sizeof(string2), "your skin has been set to %d by %s", skinid, PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:fine(playerid, params[])
{
    new id;
    new ammount;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"ui",id,ammount)) return SendClientMessage(playerid, -1, "USAGE: /fine [id] [ammount]");
    GivePlayerMoney(id, -ammount);
    format(string, sizeof(string), "you have fined %s $%d",PlayerName(id),ammount);
    format(string2, sizeof(string2), "you have been fined by %s for $%d", PlayerName(playerid), ammount);
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:time(playerid, params[])
{
    new time;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"i",time)) return SendClientMessage(playerid, -1, "USAGE: /time [00:00-23:00]");
    SetWorldTime(time);
    format(string, sizeof(string), "you have set the time to %d",time);
    format(string2, sizeof(string2), "%s has set the time to %d", PlayerName(playerid), time);
    SendClientMessage(playerid, -1, string);
    SendClientMessageToAll(-1, string2);
    return 1;
}
CMD:ban(playerid, params[])
{
    new ID;
    new reason[26];
    new banmsg[128];
    new done[120];
    new banhim[125];
    new file[65];
    if(PInfo[playerid][Padmin] == 4) return true;
    else if(sscanf(params,"us[26]",ID,reason)) return SendClientMessage(playerid, -1, "USAGE /ban [id] [reason] ");
    format(banmsg, sizeof(banmsg), "%s has banned %s for reason: %s", PlayerName(playerid), PlayerName(ID), reason);
    format(done, sizeof(done), "you have banned %s for reason: %s", PlayerName(ID), reason);
    format(banhim, sizeof(banhim), "you have been banned by %s for reason: %s", PlayerName(playerid), reason);
    SendClientMessageToAll(-1, banmsg);
    format(file, sizeof(file),"FatAdmin/Users/%s.ini",PlayerName(ID));
    dini_IntSet(file,"Banned", 1);
    SendClientMessage(playerid, -1, done);
    SendClientMessage(ID, -1, banhim);
    Ban(ID);
    return 1;
}
CMD:givecar(playerid, params[])
{
    new id;
    new carid;
    new string[128];
    new string2[128];
    new Float:X, Float:Y, Float:Z;
    new Float:angle;
    new car;
    if(PInfo[playerid][Padmin] == 2) return true;
    else if(sscanf(params,"ui",id,carid)) return SendClientMessage(playerid, -1, "USAGE: /givecar [id] [carid]");
    format(string, sizeof(string),"%s has given you a vehicle(id: %d)", PlayerName(playerid), carid);
    format(string2, sizeof(string2),"you have given %s a vehicle(id: %d",PlayerName(id), carid);
    GetPlayerPos(id, X, Y, Z);
    GetPlayerFacingAngle(id, angle);
    car = CreateVehicle(carid, X, Y, Z, angle, 0, 1, -1);
    SendClientMessage(id, -1, string);
    SendClientMessage(playerid, -1, string2);
    PutPlayerInVehicle(id, car, 0);
    return 1;
}
CMD:goto(playerid, params[])
{
    new id;
    new Float:X, Float:Y, Float:Z;
    new string[128];
    if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /goto <id>");
    GetPlayerPos(id, X, Y, Z);
    SetPlayerPos(playerid, X, Y, Z);
    format(string, sizeof(string),"you have teleported to %s",PlayerName(id));
    SendClientMessage(playerid, -1, string);
    return 1;
}
//=================================[THE END!]==========================================================================//
Код:
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(233) : warning 204: symbol is assigned a value that is never used: "russiancp"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(232) : warning 204: symbol is assigned a value that is never used: "englandcp"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(274) : warning 235: public function lacks forward declaration (symbol "OnPlayerEnterDynamicCheckpoint")
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(276) : error 017: undefined symbol "englandcp"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(280) : warning 217: loose indentation
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(787) : warning 203: symbol is never used: "SetPlayerTeamFromClass"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(86) : warning 204: symbol is assigned a value that is never used: "englandzone"
C:\Users\iphone\Desktop\Sfcnr Test Server\gamemodes\FatTDM.pwn(87) : warning 204: symbol is assigned a value that is never used: "russiazone"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

no idea how to solve it?
Reply
#6

pawn Код:
//=======================[INCLUDES]==========================================================//
#include <a_samp>
#include <zcmd>
#include <streamer>
#include <sscanf2>
#include <dini>
#include <foreach>
//========================[COLOUR DEFINES]===========================================================//
#define COLOR_ORANGE 0xFF8000FF
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BLUE1 0x0066FFFF
#define COLOR_RED 0xAA3333AA
#define COLOR_RED2 0xFF0000FF
#define COLOR_REALRED 0xFF0606FF
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_VIP 0xC93CCE00
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_BLACK 0x000000AA
//=======================[DIALOG DEFINES]==========================================================//
#define DIALOG_ESHOP 1
#define DIALOG_RSHOP 2
//===================[TEAM DEFINES]===========================================================//
#define England 1
#define Russia 2
//=========================[FORWADS]=======================================================//
forward OnPlayerEnterDynamicArea(playerid, areaid);
//=========================[BOOLS]===========================================================//
//============================[STOCKS]======================================================//
stock PlayerName(playerid) {
    new pName[24];
    GetPlayerName(playerid,pName,24);
    return pName;
}
stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    //for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}
//=========================================================================================//
//new englandzone;
//new russiazone;
new englandcp;
new russiancp;
main()
{
    print("\n*^$%Ј!<>,.?zz\\\\\\\\\\\\\\\\");
    print(" FatTDM By Thefatshizms *_* :D");
    print("!Ј$%^&*_+<>?@~:{}|\\\\\\\\\\\\\n");
}


public OnGameModeInit()
{
    englandcp = CreateDynamicCP(247.9255,1859.3064,14.0840, 2, -1, -1, -1);
    russiancp = CreateDynamicCP(-340.0471,1543.2358,75.5625, 2, -1, -1, -1);
    SetGameModeText("FatTDM");
    //==============================[CLASES]==================================================//
    AddPlayerClass(121,226.7424,1931.4076,17.6406,265.3649,24,1000,31,1000,26,1000); // englandpos1
    AddPlayerClass(179,204.5247,1869.6681,13.1406,274.2833,24,1000,31,1000,26,1000); // englandpos2
    AddPlayerClass(217,209.3599,1855.4443,20.2765,356.2324,24,1000,31,1000,26,1000); // englandpos3
    AddPlayerClass(101,-347.0208,1570.8115,75.9954,179.4697,24,1000,31,1000,26,1000); // russiapos1
    AddPlayerClass(73,-309.2180,1537.6707,75.5625,133.7227,24,1000,31,1000,26,1000); // russiapos2
    //========================================================================================//
    //englandzone = CreateDynamicRectangle(284.8186, 1805.9808, 97.5450, 1940.9124, -1, -1, -1);
    //russiazone = CreateDynamicRectangle(-202.8799, 1385.0337, -383.7028, 1631.0679, -1, -1, -1);
    return 1;
}

enum gPInfo
{
    Padmin,
    Preg,
    Ploged,
    Banned,
    Level,
    Reason,
}
new PInfo[MAX_PLAYERS][gPInfo];

public OnGameModeExit()
{
    return 1;
}
new Team[MAX_PLAYERS] = -1;
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1220.0737,-6.3703,1001.3281);
    SetPlayerInterior(playerid,2);
    SetPlayerFacingAngle(playerid,92.3402);
    SetPlayerCameraPos(playerid,1214.3527,-6.4071,1001.3290);
    SetPlayerCameraLookAt(playerid, 1220.0737,-6.3703,1000.3281);
    switch(classid)
    {
        case 0:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~P~Croatia", 1000, 6);
            Team[playerid] = 2;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~P~Croatia", 1000, 6);
            Team[playerid] = 2;
        }
    }
    return 1;
}
/*SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 1:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 2:
        {
            GameTextForPlayer(playerid, "~b~~h~England", 1000, 6);
            Team[playerid] = 1;
        }
        case 3:
        {
            GameTextForPlayer(playerid, "~p~Croatia", 1000, 6);
            Team[playerid] = 2;
        }
        case 4:
        {
            GameTextForPlayer(playerid, "~p~Croatia", 1000, 6);
            Team[playerid] = 2;
        }
    }
    return 1;
}*/

public OnPlayerConnect(playerid)
{
    new string[128];
    format(string, sizeof(string), "%s[%d] Has joined FatTDM", PlayerName(playerid), playerid);
    SendClientMessageToAll(-1, string);
    PInfo[playerid][Padmin] = 0;

    new name[MAX_PLAYERS], file[256];
    GetPlayerName(playerid,name,sizeof(name));
    format(file,sizeof(file),"FatAdmin/Users/%s.ini",name);

    if(dini_Exists(file))
    {
        SendClientMessage(playerid, -1, "Your account has been loaded you mus login or be kicked /login");
        PInfo[playerid][Preg] =1;
        PInfo[playerid][Ploged] =0;
        PInfo[playerid][Banned] =0;
        return 1;
    }
    if(!dini_Exists(file))
    {
        SendClientMessage(playerid, -1, "You need to register or be kicked /register");
        PInfo[playerid][Preg] =0;
        PInfo[playerid][Ploged] =0;
        PInfo[playerid][Banned] =0;
        return 1;
    }
    if(dini_Exists(file))
    {
            SendClientMessage(playerid, COLOR_RED, "you are banned from this server goodbye");
            PInfo[playerid][Preg] =0;
            PInfo[playerid][Ploged] =0;
            PInfo[playerid][Banned] =1;
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file),"FatAdmin/Users/%s.ini,name");
    PInfo[playerid][Ploged] =0;
    if(dini_Exists(file))
    {
        dini_IntSet(file,"PLoged",0);
        return 1;
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid, 0);
    if (PInfo[playerid][Ploged] == 0) return Kick(playerid);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); //If not invalid killerid (not a vehicle, etcetra), gets current score and adds one to the killer.
    GivePlayerMoney(playerid, random(30000 - 10000) + 10000);//Randomizes the amount of cash the person gets, 20000 - 30000
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
//public OnPlayerEnterDynamicCheckpoint(playerid, streamid)
{
    if(checkpointid == englandcp)
    {
        ShowPlayerDialog(playerid, DIALOG_ESHOP, DIALOG_STYLE_LIST, "England Shop", "full health($500)\nfull armor($500)\nGodMode($500000)\nminigun($100000)\nm4($2000)", "Buy", "cancel");
    }
    if(checkpointid == russiancp)
    {
   
    }
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_ESHOP) // Making sure its that dialog
    {

        if(response) // checking to see if they press the first button, in this case "Ok"
        {
            switch(listitem) // typically, if the beginning word is highlited in blue, you dont put a ';' at the end ok
            {
                case 0:
                {
                    if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
                    GivePlayerMoney(playerid, -500);
                    SendClientMessage(playerid, COLOR_RED, "you have bought health");
                    SetPlayerHealth(playerid, 100.0);
                }
                case 1:
                {
                    if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
                    GivePlayerMoney(playerid, -500);
                    SendClientMessage(playerid, COLOR_RED, "You have bought armour");
                    SetPlayerArmour(playerid, 100.0);
                }
                case 2:
                {
                    new string[128];
                    if(GetPlayerMoney(playerid) < 500000) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash you need $500000");
                    GivePlayerMoney(playerid, -500000);
                    SendClientMessage(playerid, COLOR_RED, "You have bought GodMode");
                    SetPlayerHealth(playerid, 10000000.0);
                    SetPlayerColor(playerid, COLOR_BLACK);
                    format(string, sizeof(string),"%s has nnow got godmode!",PlayerName(playerid));

                }
                case 3:
                {
                    if(GetPlayerMoney(playerid) < 100000) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
                    GivePlayerMoney(playerid, -100000);
                    SendClientMessage(playerid, COLOR_RED, "You have bought a minigun");
                    GivePlayerWeapon(playerid, 38, 650);
                }
                case 4:
                {
                    if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid, COLOR_RED, "You have bought a m4");
                    GivePlayerWeapon(playerid, 31, 650);
                }
            }
        }
    }
    return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
//=============================[COMMANDS]============================================//
CMD:pm(playerid, params[])
{
    new string[50];
    new sent[128];
    new id;
    if(sscanf(params,"us[50]",id,string)) return SendClientMessage(playerid, COLOR_PURPLE, "USGAE: /pm <id> <message>");
    format(string, sizeof(string),"**PM From %s**: {690069}%s", PlayerName(playerid), string);
    format(sent, sizeof(sent),"Message: Sent to %s", PlayerName(id));
    SendClientMessage(playerid, COLOR_LIGHTGREEN, sent);
    SendClientMessage(id, COLOR_PURPLE, string);
    GameTextForPlayer(playerid, "~r~Message ~b~Sent", 2000, 1);
    GameTextForPlayer(id, "~r~New Message ~b~Recived", 2000, 1);
    PlayerPlaySound(playerid, 1057, 0, 0, 0);
    PlayerPlaySound(id, 1057, 0, 0, 0);
    return 1;
}
CMD:reg(playerid, params[])
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file),"FatAdmin/Users/%s.ini",name);
    if(dini_Exists(file)) return SendClientMessage(playerid, -1, "You have already registered!");
    if(PInfo[playerid][Preg] == 1) return SendClientMessage(playerid, -1, "you have registered!");
    if(PInfo[playerid][Ploged] == 1) return SendClientMessage(playerid, -1, "you have already loged in");
    if(strlen(params))
    {
        if(!dini_Exists(file))
        {
            dini_Create(file);
            dini_Set(file,"password", params);
            dini_IntSet(file,"Preg", 0);
            dini_IntSet(file,"PLoged",0);
            dini_IntSet(file,"Padmin",0);
            PInfo[playerid][Preg] = 1;
            return SendClientMessage(playerid, -1, "congrats you registered");
        }
        else
        {
            SendClientMessage(playerid, -1, "USAGE: /reg <password>");
            return 1;
        }
    }
    return 1;
}
CMD:login(playerid, params[])
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid,name, sizeof(name));
    format(file, sizeof(file), "FatAdmin/Users/%s.ini",name);
    if(!dini_Exists(file)) return SendClientMessage(playerid,-1,"You are not registered! Please /register");
    if(PInfo[playerid][Ploged] == 1) return SendClientMessage(playerid,-1,"You are already logged in!");
    if(PInfo[playerid][Preg] == 0) return SendClientMessage(playerid,-1,"You are not registered! Please /register");
    if(strlen(params))
    {
        new pass[256];
        pass = dini_Get(file, "password");
        if(dini_Exists(file))
        {
            if(strcmp(params,pass,false) != 0)
            {
                SendClientMessage(playerid,-1,"Wrong Password!");
            }
            else
            {
                dini_IntSet(file,"Logged",1);
                PInfo[playerid][Ploged] = 1;
                PInfo[playerid][Level] = dini_Int(file,"Level");
                SendClientMessage(playerid,-1,"You have now logged in!");
                return 1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid,-1,"USAGE: /login <Password>");
        return 1;
    }
    return 1;
}
CMD:w(playerid, params[])
{
    new message[50];
    if(sscanf(params,"s[50]",message)) return SendClientMessage(playerid, -1, "USAGE: /w [text]");
    format(message, sizeof(message), "%s: %s", PlayerName(playerid), message);
    ProxDetector(5, playerid, message, -1);
    SetPlayerChatBubble(playerid, message, -1, 100.0, 10000);
    return 1;
}

//==========================[ADMIN SYSTEM]=========================================//
CMD:achat(playerid, params[])
{
    new msg[50];
    if(sscanf(params,"s[50]",msg)) return SendClientMessage(playerid, -1, "USAGE: /achat <message>");
    format(msg, sizeof(msg),"[ADMIN]:  %s",msg);
    SendClientMessageToAll(COLOR_BLUE1, msg);
    return 1;
}
CMD:fchat(playerid, params[])
{
    new id;
    new msg[50];
    if(sscanf(params,"us[50]",id,msg)) return SendClientMessage(playerid, -1, "USAGE: /fchat <id> <message>");
    format(msg, sizeof(msg),"%s %s",PlayerName(id),msg);
    SendClientMessageToAll(-1, msg);
    return 1;
}
CMD:setlvl(playerid, params[])
{
    new id;
    new lvl;
    new name[MAX_PLAYER_NAME];
    new file[128];
    new string[128];
    new string2[128];
    if(sscanf(params,"ui",id,lvl)) return SendClientMessage(playerid, -1, "USAGE: /setlvl <id> <lvl>");
    GetPlayerName(id,name,sizeof(name));
    format(file, sizeof(file),"FatAdmin/Users/%s.ini",name);
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not an RCON admin!");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"invaild id");
    PInfo[id][Padmin] = lvl;
    dini_IntSet(file,"Padmin", lvl);
    format(string2, sizeof(string),"you have been given a admin lvl of %d by %s", lvl, name);
    SendClientMessage(id, -1, string2);
    format(string, sizeof(string),"you have set %s to admin level %d", name, lvl);
    SendClientMessage(playerid, -1,string);
    return 1;
}
CMD:kick(playerid, params[]) {
    new ID, reason[24], string[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"us[24]",ID,reason)) return SendClientMessage(playerid,0xA70000FF,"Syntax: /Kick [ID] [Reason].");
    format(string,sizeof(string),"You've kicked %s for reason: %s.",PlayerName(ID),reason);
    SendClientMessage(playerid,0xFFFFFFFF,string);
    format(string,sizeof(string),"You've been kicked by %s for reason: %s.",PlayerName(playerid),reason);
    SendClientMessage(ID,0xFFFFFFFF,string);
    Kick(ID);
    return true;
}
CMD:setscore(playerid, params[])
{
    new id;
    new score;
    new msg[128];
    new msg2[128];
    if(PInfo[playerid][Padmin] == 3) return true;
    else if(sscanf(params,"ui", id, score)) return SendClientMessage(playerid, -1, "USAGE: /setscore <id> <score>");
    SetPlayerScore(id,score);
    format(msg, sizeof(msg), "you have set %s score to %d", PlayerName(id), score);
    format(msg2, sizeof(msg), "your score has been set by %s to score %d", PlayerName(playerid), score);
    SendClientMessage(playerid, -1, msg);
    SendClientMessage(id, -1, msg2);
    PlayerPlaySound(id, 5450, 0, 0, 0);
    PlayerPlaySound(playerid, 5201, 0, 0, 0);
    return 1;
}
CMD:givewep(playerid, params[])
{
    new id;
    new gunid;
    new wepstring[128];
    new wepstring2[128];
    if(PInfo[playerid][Padmin] == 3) return true;
    else if(sscanf(params,"ui",id,gunid)) return SendClientMessage(playerid, -1, "usage: /givewep <id> <wepid>");
    GivePlayerWeapon(id, gunid, 500);
    format(wepstring, sizeof(wepstring), "you have given %s a gun", PlayerName(id));
    format(wepstring2, sizeof(wepstring2), "you have been given a gun by %s", PlayerName(playerid));
    SendClientMessage(playerid, -1, wepstring);
    SendClientMessage(id, -1, wepstring2);
    return 1;
}
CMD:explode(playerid, params[])
{
    new id;
    new allstring[128];
    new mestring[128];
    new youstring[128];
    new Float:X, Float:Y, Float:Z;
    if(PInfo[playerid][Padmin] == 3) return true;
    else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /explode [id]");
    GetPlayerPos(id, X, Y, Z);
    CreateExplosion(X, Y, Z, 0, 1);
    format(allstring, sizeof(allstring), "%s has exploded %s", PlayerName(playerid), PlayerName(id));
    format(mestring, sizeof(mestring), "you have exploded %s", PlayerName(id));
    format(youstring, sizeof(youstring), "you have been exploded by %s", PlayerName(playerid));
    SendClientMessageToAll(-1, allstring);
    SendClientMessage(playerid, -1, mestring);
    SendClientMessage(id, -1, youstring);
    return 1;
}
CMD:ann(playerid, params[])
{
    new text[50];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"s[50]",text)) return SendClientMessage(playerid, -1, "USAGE: /ann [text]");
    GameTextForAll(text, 10000, 6);
    return 1;
}
CMD:gethere(playerid, params[])
{
    new id;
    new Float:X, Float:Y, Float:Z;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /gethere [id]");
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(id, X, Y, Z);
    format(string, sizeof(string), "you have teleported %s to your position", PlayerName(id));
    format(string2, sizeof(string2), "you have been teleported to %s's position", PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:freeze(playerid, params[])
{
    new id;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /freeze [id]");
    TogglePlayerControllable(id, 0);
    format(string, sizeof(string), "you have frozen %s", PlayerName(id));
    format(string2, sizeof(string2), "you have been frozen by %s", PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:unfreeze(playerid, params[])
{
    new id;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /unfreeze [id]");
    TogglePlayerControllable(id, 1);
    format(string, sizeof(string), "you have unfrozen %s", PlayerName(id));
    format(string2, sizeof(string2), "you have been unfrozen by %s", PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:setskin(playerid, params[])
{
    new id;
    new skinid;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"ui",id,skinid)) return SendClientMessage(playerid, -1, "USAGE: /setskin [id] [skinid]");
    SetPlayerSkin(id, skinid);
    format(string, sizeof(string), "you have made %s skin id %d",PlayerName(id),skinid);
    format(string2, sizeof(string2), "your skin has been set to %d by %s", skinid, PlayerName(playerid));
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:fine(playerid, params[])
{
    new id;
    new ammount;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"ui",id,ammount)) return SendClientMessage(playerid, -1, "USAGE: /fine [id] [ammount]");
    GivePlayerMoney(id, -ammount);
    format(string, sizeof(string), "you have fined %s $%d",PlayerName(id),ammount);
    format(string2, sizeof(string2), "you have been fined by %s for $%d", PlayerName(playerid), ammount);
    SendClientMessage(playerid, -1, string);
    SendClientMessage(id, -1, string2);
    return 1;
}
CMD:time(playerid, params[])
{
    new time;
    new string[128];
    new string2[128];
    if(PInfo[playerid][Padmin] == 1) return true;
    else if(sscanf(params,"i",time)) return SendClientMessage(playerid, -1, "USAGE: /time [00:00-23:00]");
    SetWorldTime(time);
    format(string, sizeof(string), "you have set the time to %d",time);
    format(string2, sizeof(string2), "%s has set the time to %d", PlayerName(playerid), time);
    SendClientMessage(playerid, -1, string);
    SendClientMessageToAll(-1, string2);
    return 1;
}
CMD:ban(playerid, params[])
{
    new ID;
    new reason[26];
    new banmsg[128];
    new done[120];
    new banhim[125];
    new file[65];
    if(PInfo[playerid][Padmin] == 4) return true;
    else if(sscanf(params,"us[26]",ID,reason)) return SendClientMessage(playerid, -1, "USAGE /ban [id] [reason] ");
    format(banmsg, sizeof(banmsg), "%s has banned %s for reason: %s", PlayerName(playerid), PlayerName(ID), reason);
    format(done, sizeof(done), "you have banned %s for reason: %s", PlayerName(ID), reason);
    format(banhim, sizeof(banhim), "you have been banned by %s for reason: %s", PlayerName(playerid), reason);
    SendClientMessageToAll(-1, banmsg);
    format(file, sizeof(file),"FatAdmin/Users/%s.ini",PlayerName(ID));
    dini_IntSet(file,"Banned", 1);
    SendClientMessage(playerid, -1, done);
    SendClientMessage(ID, -1, banhim);
    Ban(ID);
    return 1;
}
CMD:givecar(playerid, params[])
{
    new id;
    new carid;
    new string[128];
    new string2[128];
    new Float:X, Float:Y, Float:Z;
    new Float:angle;
    new car;
    if(PInfo[playerid][Padmin] == 2) return true;
    else if(sscanf(params,"ui",id,carid)) return SendClientMessage(playerid, -1, "USAGE: /givecar [id] [carid]");
    format(string, sizeof(string),"%s has given you a vehicle(id: %d)", PlayerName(playerid), carid);
    format(string2, sizeof(string2),"you have given %s a vehicle(id: %d",PlayerName(id), carid);
    GetPlayerPos(id, X, Y, Z);
    GetPlayerFacingAngle(id, angle);
    car = CreateVehicle(carid, X, Y, Z, angle, 0, 1, -1);
    SendClientMessage(id, -1, string);
    SendClientMessage(playerid, -1, string2);
    PutPlayerInVehicle(id, car, 0);
    return 1;
}
CMD:goto(playerid, params[])
{
    new id;
    new Float:X, Float:Y, Float:Z;
    new string[128];
    if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /goto <id>");
    GetPlayerPos(id, X, Y, Z);
    SetPlayerPos(playerid, X, Y, Z);
    format(string, sizeof(string),"you have teleported to %s",PlayerName(id));
    SendClientMessage(playerid, -1, string);
    return 1;
}
//=================================[THE END!]==========================================================================//
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)