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", 5000, 1);
new Text3D:AFKTextLabel[MAX_PLAYERS];
AFKTextLabel[playerid] = Create3DTextLabel( "AFK", 0xFF0000FF, 0.0, 0.0, 2.0, 40, 0, 0); //error
Attach3DTextLabelToPlayer(AFKTextLabel[playerid], playerid, 0.0, 0.0, 0.4);
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, kuldoneve, sizeof(kuldoneve));
format(string, sizeof(string), "[DareDevil] %s %s(%d) now away from keyboard", GetLevel(playerid), kuldoneve, playerid);
SendClientMessageToAll(0xFFFF00AA, string);
return 1;
}
else return ShowPlayerDialog(playerid, 5, DIALOG_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 1: ranklevel = "Newest Devil";
case 2: ranklevel = "Proud Devil";
case 3: ranklevel = "Light Devil";
case 4: ranklevel = "Experienced Devil";
case 5: ranklevel = "Doom Knight";
case 6: ranklevel = "Death Wisher";
case 7: ranklevel = "Golden Devil";
case 8: ranklevel = "Elite Devils";
case 9: ranklevel = "The Maestro";
case 10: ranklevel = "The DareDevils";
}
return ranklevel;
}