cmd_afk should return a value - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: cmd_afk should return a value (
/showthread.php?tid=520943)
cmd_afk should return a value -
[Cali]ChrOnic_T - 20.06.2014
[B]I know this a really easy question but i do not know how to fix this! please help.[
The Title says the error i get when i compile./B]
pawn Код:
CMD:afk(playerid,params[])
{
new str[144];
new afkname[144];
new Float:health;
new Float:x, Float:y, Float:z;
GetPlayerName(playerid,afkname,sizeof(afkname));
GetPlayerHealth(playerid,health);
if (health < 70.0) return SendClientMessage(playerid,0xE6421AC8,"{11EEC1}» {FF0000}You need atleast 70 HP to go afk.");
format(str,sizeof(str),"{FFFFFF}%s[%d] 0xFF1A00C8has went on AFK-MODE. ",afkname,playerid);
SendClientMessage(playerid,-1,str);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid,264.4454,77.4404,1001.0391);
SetPlayerFacingAngle(playerid,273.0648);
SetPlayerInterior(playerid,6);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
}
else // So when they type it again there off AFK
{
SendClientMessage(playerid,0x15EAEAC8,"You Are Now OFF AFK Mode");
SetPlayerPos(playerid,x,y,z);
TogglePlayerControllable(playerid,1);
SetPlayerHealth(playerid,health);
SetPlayerInterior(playerid,0);
}
return 1;
}
AW: cmd_afk should return a value -
rospar - 21.06.2014
Код:
CMD:afk(playerid,params[])
{
if(GetPVarInt(playerid,"IsAFK") == 0)// No AFK Mode
{
new str[144];
new afkname[144];
new Float:health;
new Float:x, Float:y, Float:z;
GetPlayerName(playerid,afkname,sizeof(afkname));
GetPlayerHealth(playerid,health);
if (health < 70.0) return SendClientMessage(playerid,0xE6421AC8,"{11EEC1}» {FF0000}You need atleast 70 HP to go afk.");
format(str,sizeof(str),"{FFFFFF}%s[%d] 0xFF1A00C8has went on AFK-MODE. ",afkname,playerid);
SendClientMessage(playerid,-1,str);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid,264.4454,77.4404,1001.0391);
SetPlayerFacingAngle(playerid,273.0648);
SetPlayerInterior(playerid,6);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
SetPVarInt(playerid,"IsAFK",1);// Set AFK Mode
}
else // So when they type it again there off AFK
{
SendClientMessage(playerid,0x15EAEAC8,"You Are Now OFF AFK Mode");
SetPlayerPos(playerid,x,y,z);
TogglePlayerControllable(playerid,1);
SetPlayerHealth(playerid,health);
SetPlayerInterior(playerid,0);
SetPVarInt(playerid,"IsAFK",0);// Remove
}
return 1;
}