SA-MP Forums Archive
Noob Question - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Noob Question (/showthread.php?tid=193298)



Noob Question - marinov - 25.11.2010

What's wrong with this ?

pawn Код:
if(strcmp(cmd, "/aduty", true) == 0)
    {
    if(IsPlayerAdmin(playerid, 1))
    {
        GameTextForAll(playerid, "Admin %s is now on duty.", 6000);
        }
    return 1;
    }



Re: Noob Question - Jeffry - 25.11.2010

pawn Код:
if(strcmp(cmd, "/aduty", true) == 0)
{
    if(IsPlayerAdmin(playerid))
    {
        new string[128], playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername, sizeof(playername));
        format(string, 128, "Admin %s is now on duty.", playername);
        GameTextForAll(string, 6000, 3);
    }
    return 1;
}
Should do it.


Re: Noob Question - marinov - 25.11.2010

pawn Код:
C:\Users\Marino Varesio\Desktop\zombie outbreak\gamemodes\Zombie_Outbreak_Original.pwn(1323) : warning 202: number of arguments does not match definition
C:\Users\Marino Varesio\Desktop\zombie outbreak\gamemodes\Zombie_Outbreak_Original.pwn(1325) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Marino Varesio\Desktop\zombie outbreak\gamemodes\Zombie_Outbreak_Original.pwn(1325) : warning 219: local variable "playername" shadows a variable at a preceding level
C:\Users\Marino Varesio\Desktop\zombie outbreak\gamemodes\Zombie_Outbreak_Original.pwn(1328) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.



Re: Noob Question - Jeffry - 25.11.2010

Mew, you've already used this variables.

pawn Код:
if(strcmp(cmd, "/aduty", true) == 0)
{
    if(IsPlayerAdmin(playerid))
    {
        new msgstring[128], player123name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, player123name, sizeof(player123name));
        format(msgstring, 128, "Admin %s is now on duty.", player123name);
        GameTextForAll(msgstring, 6000, 3);
    }
    return 1;
}
Try now. :P


Re: Noob Question - marinov - 25.11.2010

works now thanx

and happy thanksgiving


Re: Noob Question - Jeffry - 25.11.2010

Quote:
Originally Posted by marinov
Посмотреть сообщение
works now thanx

and happy thanksgiving
No problem. Have fun.