AFk system prob.
#1

AFk system prob.


My Code:
Код:
	if(strcmp(cmd, "/afk", true) == 0)
	{
	    new name[MAX_PLAYER_NAME], string[100];
	    new Float:x, Float:y, Float:z;
 	        GetPlayerName(playerid, name, sizeof(name));
  		format(string, sizeof(string), "[AFK] %s Is Now Afk (Away From Keyboard)", name );
   		SendClientMessageToAll(COLOR_GROVE, string);
        GetPlayerPos(playerid, x, y, z);
	    SetPlayerPos(playerid, x y, z+800):
	}
Errors:
Код:
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(33395) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(33401) : error 001: expected token: ",", but found "-identifier-"
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(33401) : warning 215: expression has no effect
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(33401) : warning 215: expression has no effect
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(33401) : error 001: expected token: ";", but found ")"
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(33401) : error 029: invalid expression, assumed zero
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(33401) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

pawn Код:
if(strcmp(cmd, "/afk", true) == 0)
    {
        new name[MAX_PLAYER_NAME];
        new Float:x, Float:y, Float:z;
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "[AFK] %s Is Now Afk (Away From Keyboard)", name );
        SendClientMessageToAll(COLOR_GROVE, string);
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(playerid, x, y, z+800);
        SendClientMessageToAll(COLOR_GROVE,string);
        return 1;}
Reply
#3

Try this

pawn Код:
if(strcmp(cmd, "/afk", true) == 0)
{
    new name[MAX_PLAYER_NAME];
    new Float:x, Float:y, Float:z;
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[AFK] %s Is Now Afk (Away From Keyboard)", name );
    SendClientMessageToAll(COLOR_GROVE, string);
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z+800);
    SendClientMessageToAll(COLOR_GROVE, string);
    return 1;
}
Reply
#4

ty gonna give u rep
Reply
#5

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/afk", true) == 0)
    {
        new name[MAX_PLAYER_NAME];
        new Float:x, Float:y, Float:z;
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "[AFK] %s Is Now Afk (Away From Keyboard)", name );
        SendClientMessageToAll(COLOR_GROVE, string);
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(playerid, x, y, z+800);
        SendClientMessageToAll(COLOR_GROVE,string);
        return 1;}
Quote:
Originally Posted by MarinacMrcina
Посмотреть сообщение
Try this

pawn Код:
if(strcmp(cmd, "/afk", true) == 0)
{
    new name[MAX_PLAYER_NAME];
    new Float:x, Float:y, Float:z;
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[AFK] %s Is Now Afk (Away From Keyboard)", name );
    SendClientMessageToAll(COLOR_GROVE, string);
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z+800);
    SendClientMessageToAll(COLOR_GROVE, string);
    return 1;
}
MarinacMrcina, did you just copy IronBoy?
You both added a "SendClientMessageToAll" that isn't in the original post. Coincidence?

Anyway, just a tip for the creator of this topic, you'll get the message twice..
Reply
#6

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
MarinacMrcina, did you just copy IronBoy?
You both added a "SendClientMessageToAll" that isn't in the original post. Coincidence?

Anyway, just a tip for the creator of this topic, you'll get the message twice..
I didn't noticed it.

pawn Код:
if(strcmp(cmd, "/afk", true) == 0)
{
    new name[MAX_PLAYER_NAME];
    new Float:x, Float:y, Float:z;
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[AFK] %s Is Now Afk (Away From Keyboard)", name );
    SendClientMessageToAll(COLOR_GROVE, string);
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z+800);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)