I got a problem.
#1

Hello everybody
I got a problem in scripting. I would be thankful if you can help me to solve it.

Errors are
PHP код:
C:\Users\pc\Desktop\BTTDM\SATDM v9 Testing server\Gamemodes\Kyrie.pwn(53642) : warning 219local variable "AFK" shadows a variable at a preceding level
C
:\Users\pc\Desktop\BTTDM\SATDM v9 Testing server\Gamemodes\Kyrie.pwn(53642) : error 001expected token";"but found "("
C:\Users\pc\Desktop\BTTDM\SATDM v9 Testing server\Gamemodes\Kyrie.pwn(53642) : error 029invalid expressionassumed zero
C
:\Users\pc\Desktop\BTTDM\SATDM v9 Testing server\Gamemodes\Kyrie.pwn(53642) : error 029invalid expressionassumed zero
C
:\Users\pc\Desktop\BTTDM\SATDM v9 Testing server\Gamemodes\Kyrie.pwn(53642) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

and code is here

Код:
CMD:ddafk(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][DD] >= 1) {
        new string[256],kuldoneve[MAX_PLAYER_NAME];
        SendClientMessage(playerid,0x99FF00AA,"Type /ddback when you back.");
        GameTextForPlayer(playerid,"~r~ You are now AFK", 5000, 1);
        new Text3D:AFK([playerid]) = Create3DTextLabel( "AFK", 0xFF0000FF, 0.0, 0.0, 2.0, 40, 0, 0); //error
        Attach3DTextLabelToPlayer( AFK[playerid], playerid, 0.0, 0.0, 0.4);
        TogglePlayerControllable(playerid, 0);
        GetPlayerName(playerid, kuldoneve, sizeof(kuldoneve));
        format(string, sizeof(string), "[DareDevil]Newest Devil %s now away from keyboard",kuldoneve, playerid);
        if(PlayerInfo[playerid][DD] == 2)
        format(string, sizeof(string), "[DareDevil]Proud Devil %s now away from keyboard",kuldoneve, playerid);
        if(PlayerInfo[playerid][DD] == 3)
        format(string, sizeof(string), "[DareDevil]Light Devil%s now away from keyboard",kuldoneve, playerid);
        if(PlayerInfo[playerid][DD] == 4)
        format(string, sizeof(string), "[DareDevil]Experienced Devil %s now away from keyboard",kuldoneve, playerid);
        if(PlayerInfo[playerid][DD] == 5)
        format(string, sizeof(string), "[DareDevil]Doom Knight %s now away from keyboard",kuldoneve, playerid);
        if(PlayerInfo[playerid][DD] == 6)
        format(string, sizeof(string), "[DareDevil]Death Wisher %s now away from keyboard",kuldoneve, playerid);
        if(PlayerInfo[playerid][DD] == 7)
        format(string, sizeof(string), "[DareDevil]Golden Devil %s now away from keyboard",kuldoneve, playerid);
        if(PlayerInfo[playerid][DD] == 8)
        format(string, sizeof(string), "[DareDevil]Elite Devils %s now away from keyboard",kuldoneve, playerid);
        if(PlayerInfo[playerid][DD] == 9)
        format(string, sizeof(string), "[DareDevil]The Maestro %s now away from keyboard",kuldoneve, playerid);
        if(PlayerInfo[playerid][DD] == 10)
        format(string, sizeof(string), "[DareDevil]The DareDevils %s now away from keyboard",kuldoneve, playerid);
        SendClientMessageToAll(0xFFFF00AA, string);
    } else return ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "ERROR", "You need to be higher DD Level to use this command", "OK", "Cancel");
    return 1;}
its fully code of command.
Thanks.
Reply
#2

PHP код:
AFK[playerid] = Create3DTextLabel("AFK"0xFF0000FF0.00.02.04000); 
Reply
#3

PHP код:
CMD:ddafk(playerid,params[]) 
{
    if(
PlayerInfo[playerid][DD] >= 1
    {
        new 
string[256],kuldoneve[MAX_PLAYER_NAME];
        
SendClientMessage(playerid,0x99FF00AA,"Type /ddback when you back.");
        
GameTextForPlayer(playerid,"~r~ You are now AFK"50001);
        new 
Text3D:AFKTextLabel[MAX_PLAYERS];
        
AFKTextLabel[playerid] = Create3DTextLabel"AFK"0xFF0000FF0.00.02.04000); //error
        
Attach3DTextLabelToPlayer(AFKTextLabel[playerid], playerid0.00.00.4);
        
TogglePlayerControllable(playerid0);
        
GetPlayerName(playeridkuldonevesizeof(kuldoneve));
        
format(stringsizeof(string), "[DareDevil] %s %s(%d) now away from keyboard"GetLevel(playerid), kuldoneveplayerid);
        
SendClientMessageToAll(0xFFFF00AAstring);
        return 
1;
    } 
    else return 
ShowPlayerDialog(playerid5DIALOG_STYLE_MSGBOX"ERROR""You need to be higher DD Level to use this command""OK""Cancel");
}

GetLevel(playerid)
{
    new 
ranklevel[36];
    switch(
PlayerInfo[playerid][DD])
    {
        case 
1ranklevel "Newest Devil";
        case 
2ranklevel "Proud Devil";
        case 
3ranklevel "Light Devil";
        case 
4ranklevel "Experienced Devil";
        case 
5ranklevel "Doom Knight";
        case 
6ranklevel "Death Wisher";
        case 
7ranklevel "Golden Devil";
        case 
8ranklevel "Elite Devils";
        case 
9ranklevel "The Maestro";
        case 
10ranklevel "The DareDevils";
    }
    return 
ranklevel;

Reply
#4

Here you go
PHP код:
CMD:ddafk(playerid,params[]) {
    
#pragma unused params
    
if(PlayerInfo[playerid][DD] >= 1) {
        new 
string[256],kuldoneve[MAX_PLAYER_NAME];
        new 
Text3DAFK[MAX_PLAYERS];
        
SendClientMessage(playerid,0x99FF00AA,"Type /ddback when you back.");
        
GameTextForPlayer(playerid,"~r~ You are now AFK"50001);
        
AFK[playerid] = Create3DTextLabel("AFK"0xFF0000FF0.00.02.04000);
        
Attach3DTextLabelToPlayerAFK[playerid], playerid0.00.00.4);
        
TogglePlayerControllable(playerid0);
        
GetPlayerName(playeridkuldonevesizeof(kuldoneve));
        
format(stringsizeof(string), "[DareDevil]Newest Devil %s now away from keyboard",kuldoneveplayerid);
        if(
PlayerInfo[playerid][DD] == 2)
        
format(stringsizeof(string), "[DareDevil]Proud Devil %s now away from keyboard",kuldoneveplayerid);
        if(
PlayerInfo[playerid][DD] == 3)
        
format(stringsizeof(string), "[DareDevil]Light Devil%s now away from keyboard",kuldoneveplayerid);
        if(
PlayerInfo[playerid][DD] == 4)
        
format(stringsizeof(string), "[DareDevil]Experienced Devil %s now away from keyboard",kuldoneveplayerid);
        if(
PlayerInfo[playerid][DD] == 5)
        
format(stringsizeof(string), "[DareDevil]Doom Knight %s now away from keyboard",kuldoneveplayerid);
        if(
PlayerInfo[playerid][DD] == 6)
        
format(stringsizeof(string), "[DareDevil]Death Wisher %s now away from keyboard",kuldoneveplayerid);
        if(
PlayerInfo[playerid][DD] == 7)
        
format(stringsizeof(string), "[DareDevil]Golden Devil %s now away from keyboard",kuldoneveplayerid);
        if(
PlayerInfo[playerid][DD] == 8)
        
format(stringsizeof(string), "[DareDevil]Elite Devils %s now away from keyboard",kuldoneveplayerid);
        if(
PlayerInfo[playerid][DD] == 9)
        
format(stringsizeof(string), "[DareDevil]The Maestro %s now away from keyboard",kuldoneveplayerid);
        if(
PlayerInfo[playerid][DD] == 10)
        
format(stringsizeof(string), "[DareDevil]The DareDevils %s now away from keyboard",kuldoneveplayerid);
        
SendClientMessageToAll(0xFFFF00AAstring);
    } else return 
ShowPlayerDialog(playerid5DIALOG_STYLE_MSGBOX"ERROR""You need to be higher DD Level to use this command""OK""Cancel");
    return 
1;} 
Reply
#5

Hmm
Thanks.
I will check it tommorow.
Reply
#6

Quote:
Originally Posted by oMa37
Посмотреть сообщение
PHP код:
CMD:ddafk(playerid,params[]) 
{
    if(
PlayerInfo[playerid][DD] >= 1
    {
        new 
string[256],kuldoneve[MAX_PLAYER_NAME];
        
SendClientMessage(playerid,0x99FF00AA,"Type /ddback when you back.");
        
GameTextForPlayer(playerid,"~r~ You are now AFK"50001);
        new 
Text3D:AFKTextLabel[MAX_PLAYERS];
        
AFKTextLabel[playerid] = Create3DTextLabel"AFK"0xFF0000FF0.00.02.04000); //error
        
Attach3DTextLabelToPlayer(AFKTextLabel[playerid], playerid0.00.00.4);
        
TogglePlayerControllable(playerid0);
        
GetPlayerName(playeridkuldonevesizeof(kuldoneve));
        
format(stringsizeof(string), "[DareDevil] %s %s(%d) now away from keyboard"GetLevel(playerid), kuldoneveplayerid);
        
SendClientMessageToAll(0xFFFF00AAstring);
        return 
1;
    } 
    else return 
ShowPlayerDialog(playerid5DIALOG_STYLE_MSGBOX"ERROR""You need to be higher DD Level to use this command""OK""Cancel");
}
GetLevel(playerid)
{
    new 
ranklevel[36];
    switch(
PlayerInfo[playerid][DD])
    {
        case 
1ranklevel "Newest Devil";
        case 
2ranklevel "Proud Devil";
        case 
3ranklevel "Light Devil";
        case 
4ranklevel "Experienced Devil";
        case 
5ranklevel "Doom Knight";
        case 
6ranklevel "Death Wisher";
        case 
7ranklevel "Golden Devil";
        case 
8ranklevel "Elite Devils";
        case 
9ranklevel "The Maestro";
        case 
10ranklevel "The DareDevils";
    }
    return 
ranklevel;

That one worked.
Thanks !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)