String Help
#1

pawn Код:
public OnPlayerConnect(playerid)
{
Line 18----     format(string, sizeof(string), "* %s has joined the server.", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
}

Код:
C:\Documents and Settings\Mikeeey\Desktop\GTA SA TEST\gamemodes\bare.pwn(18) : error 017: undefined symbol "string"
C:\Documents and Settings\Mikeeey\Desktop\GTA SA TEST\gamemodes\bare.pwn(18) : error 017: undefined symbol "string"
C:\Documents and Settings\Mikeeey\Desktop\GTA SA TEST\gamemodes\bare.pwn(18) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Mikeeey\Desktop\GTA SA TEST\gamemodes\bare.pwn(18) : 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

add this
pawn Код:
new string[72];
above format line


EDIT:
Add this
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[128], name[28];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "* %s has joined the server.", pname);
    SendClientMessageToAll(0xAAAAAAAA, string);
    return 1;
}
Reply
#3

Thanks knew I forgot something
Reply
#4

I've updated the script, refresh if you haven't.
Reply
#5

Thanks mate
Reply
#6

pawn Код:
stock pName(iPlayer)
{
    new
        iName[MAX_PLAYER_NAME];
 
    GetPlayerName(iPlayer, iName, sizeof(iName));
    return iName;
}

public OnPlayerConnect(playerid)
{
    new
        iStr[60];

    format(iStr, sizeof(iStr), "* %s has joined the server.", pName(playerid));
    SendClientMessage(playerid, 0xAAAAAAA, iStr);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)