#1

And guys i made some cmds but after plying few mins in server my server turns down and get a string error. How to fix these cmds?:
Код:
CMD:slap(playerid, params[])
{
        new id, string[256], name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], Float:x, Float:y, Float:z;
        if(PInfo[playerid][PlayerLevel] >= 3) { //insert your own enum here
        if(sscanf(params,"i",id)) return SendClientMessage(playerid, 0xFF000FF, "USAGE: /slap [id]");
        GetPlayerPos(id, x, y, z);
        SetPlayerPos(id, x, y, z + 10);
        GetPlayerName(playerid, name1, sizeof(name1));
        GetPlayerName(id, name2, sizeof(name2));
        format(string, sizeof(string), "{FF0000}[Admin]:{FF0000} %s {FFFFFF}has slapped{FFCC00} %s",name1,name2);
        SendClientMessageToAll(-1, string);
        } else SendClientMessage(playerid, 0xFF0000FF, "{FF0000}ERROR: Only Level 3 admins can access this.");
        return 1;
}
CMD:giveweapon(playerid, params[])
{
        new id, wep, bullet, wepname[25], string[256], name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
        if(PInfo[playerid][PlayerLevel] >= 3) {
        if(sscanf(params,"iii",id,wep,bullet)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}USAGE: /giveweapon [id] [weaponid] [bullets]");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}ERROR: Player is not connected!");
        GivePlayerWeapon(id, wep, bullet);
        GetWeaponName(wep, wepname, sizeof(wepname));
        GetPlayerName(playerid, name1, sizeof(name1));
        GetPlayerName(id, name2, sizeof(name2));
        format(string, sizeof(string), "{FF0000}[Admin]{FFFFFF}: {FF0000} %s {FFFFFF}has given {FFCC00}%s {FFFFFF}a{009900} %s(%d)!",name1,name2,wepname,bullet);
        SendClientMessageToAll(-1, string);
        } else SendClientMessage(playerid, 0xFF0000FF, "{FF0000}ERROR: Only Level 3 admins can access this.");
        return 1;
}

CMD:disarm(playerid, params[])
{
        new id, reason, name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[256];
        if(PInfo[playerid][PlayerLevel] >= 3) {
        if(sscanf(params,"is",id,reason)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}USAGE: /disarm [id] [reason]");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}ERROR: Player is not connected!");
        GetPlayerName(playerid, name1, sizeof(name1));
        GetPlayerName(id, name2, sizeof(name2));
        ResetPlayerWeapons(id);
        format(string, sizeof(string), "{FF0000}[Admin]{FFFFFF}:{FF0000} %s {FFFFFF}has disarmed {FFCC00}%s.{FFFFFF} Reason: %s",name1,name2,reason);
        SendClientMessageToAll(-1, string);
        } else SendClientMessage(playerid, 0xFF0000FF, "{FF0000}ERROR: Only Level 3 admins can access this.");
        return 1;
}

CMD:explode(playerid, params[])
{
        new id, reason, name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[256], Float:x, Float:y, Float:z;
        if(PInfo[playerid][PlayerLevel] >= 7) {
        if(sscanf(params,"is",id,reason)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}USAGE: /explode [id] [reason]");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}ERROR: Player is not connected!");
        GetPlayerName(playerid, name1, sizeof(name1));
        GetPlayerName(id, name2, sizeof(name2));
        GetPlayerPos(id, x, y, z);
        CreateExplosion(x, y, z, 12, 10.0);
        format(string, sizeof(string), "{FF0000}[Admin]{FFFFFF}: {FF0000}%s{FFFFFF} has exploded {FFCC00}%s. {FFCC00}Reason:{FFFFFF} %s",name1,name2,reason);
        SendClientMessageToAll(-1, string);
        } else SendClientMessage(playerid, 0xFF0000FF, "{FF0000}ERROR: Only Level 3 admins can access this.");
        return 1;
}

CMD:akill(playerid, params[])
{
        new id, reason, name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[256];
        if(PInfo[playerid][PlayerLevel] >= 3) {
        if(sscanf(params,"is",id,reason)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}USAGE: /akill [id] [reason]");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}ERROR: Player is not connected!");
        GetPlayerName(playerid, name1, sizeof(name1));
        GetPlayerName(id, name2, sizeof(name2));
        SetPlayerHealth(id, 0);
        format(string, sizeof(string), "{FF0000}[Admin]{FFFFFF}: {FF0000}%s{FFFFFF} has killed {FFCC00}%s. {FFFFFF}Reason: %s",name1,name2,reason);
        SendClientMessageToAll(-1, string);
        } else SendClientMessage(playerid, 0xFF0000FF, "{FF0000}ERROR: Only Level 3 admins can access this.");
        return 1;
}
Reply
#2

can you show me the enum that you're using to store the player data ?
search for
enum
Reply
#3

You didn't define APlayerData anywhere in the script..
as i can see you'r having errors in a single line "19606"

you should check the line 1st.. Press crtl + g and enter the line 19606 press find.. then read the line carefully.
Reply
#4

new APlayerData[MAX_PLAYERS];
Reply
#5

old problem is fixed so i removed it.. and guys please help me about these cmds... fix it .. has string problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)