WHAT?!!
#1

hey When i convert Dcmd To Zcmd it gives me these errors
pawn Код:
CMD:vslap(playerid,params[])
{
    if(PlayerInfo[playerid][LoggedIn] == 1) {
    if(GetPVarInt(playerid, "vip") < 1) return SendClientMessage(playerid, 0xFF0000FF, "Your not a Diamon vip(Level 3).");
            new tmp[256], tmp2[256], Index;     tmp = strtok(params,Index), tmp2 = strtok(params,Index);
            if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /slap [playerid] [reason/with]");
            new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            player1 = strval(tmp);

            if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
                GetPlayerName(player1, playername, sizeof(playername));     GetPlayerName(playerid, adminname, sizeof(adminname));
                CMDMessageToAdmins(playerid,"SLAP");
                new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(player1,Health); SetPlayerHealth(player1,Health-25);
                GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+5); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);

                if(strlen(tmp2)) {
                    format(string,sizeof(string),"You have been slapped by Vip %s %s ",adminname,params[2]);    SendClientMessage(player1,red,string);
                    format(string,sizeof(string),"You have slapped %s %s ",playername,params[2]); return SendClientMessage(playerid,blue,string);
                } else {
                    format(string,sizeof(string),"You have been slapped by Vip %s ",adminname); SendClientMessage(player1,red,string);
                    format(string,sizeof(string),"You have slapped %s",playername); return SendClientMessage(playerid,blue,string); }
            } else return SendClientMessage(playerid, red, "Player is not connected or is the highest level admin");
    } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Here are The Errors
pawn Код:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\TDM.pwn(684) : error 017: undefined symbol "PlayerInfo"
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\TDM.pwn(684) : warning 215: expression has no effect
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\TDM.pwn(684) : error 001: expected token: ";", but found "]"
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\TDM.pwn(684) : error 029: invalid expression, assumed zero
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\TDM.pwn(684) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

No Help it's important
Reply
#3

the error is saying that you didnt define PlayerInfo
Reply
#4

pawn Код:
enum PlayerInfo = {
Logged ,
Regged ,
Level
} ;
Reply
#5

when i added this on the top
pawn Код:
enum PlayerInfo =
{
Logged ,
Regged ,
Level
} ;
these errors come
pawn Код:
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\TDM.pwn(229) : error 001: expected token: "{", but found "="
I:\Games\RockStar Game Gta San Andreas\Gta Sanandreas\My Script\gamemodes\TDM.pwn(229 -- 234) : error 008: must be a constant expression; assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#6

Hm... i removed = and no errors now and it should be enum playerinfo or playerdata?
Reply
#7

Yes, there is no '=' sign.
Reply
#8

ok but
pawn Код:
CMD:vslap(playerid,params[])
{
        if(GetPVarInt(playerid, "vip") < 2) return SendClientMessage(playerid, 0xFF0000FF, "Your not a Diamond vip(Level 3).");
            new tmp[256], tmp2[256], Index;     tmp = strtok(params,Index), tmp2 = strtok(params,Index);
            if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /slap [playerid] [reason/with]");
            new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
            player1 = strval(tmp);

                GetPlayerName(player1, playername, sizeof(playername));     GetPlayerName(playerid, adminname, sizeof(adminname));
                new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(player1,Health); SetPlayerHealth(player1,Health-25);
                GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+5); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);

                if(strlen(tmp2)) {
                    format(string,sizeof(string),"You have been slapped by Vip%s %s ",adminname,params[2]); SendClientMessage(player1,red,string);
                    format(string,sizeof(string),"You have slapped %s %s ",playername,params[2]); return SendClientMessage(playerid,blue,string);
                } else {
                    format(string,sizeof(string),"You have been slapped by Vip %s ",adminname); SendClientMessage(player1,red,string);
                    format(string,sizeof(string),"You have slapped %s",playername); return SendClientMessage(playerid,blue,string);}
}
when i type /slap it slaps my self and don't say you have been slaped by vip(name) can someone fix it and make it like in Lux Admin or Ladmin but it will be for Vip
Reply
#9

Use Zcmd + Sscanf2.
Reply
#10

Isn't the name Mr_Scripter a little presumptuous for a post like this??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)