werid problem.
#1

Hey guys, When i type /setcallsign it only allows me to put 2 characters after it. although i can put four characters after it put it shows "Invaild command", so i'v missed out a return 1 somewhere. the callsign is meant to be 8 characters and it saves to the database perfectly.

pawn Код:
//you can use this to check your current call-sign
command(mycallsign,playerid, params[])
{
    new string[70];
    format(string,sizeof(string),"Your callsign is - %s",PlayerInfo[playerid][CallSign]) && SendClientMessage(playerid, COLOR_WHITE,string);
    return 1;
}
//how you set your new call sign,
command(setcallsign,playerid, params[])
{
    new SetCallSign;
    if(sscanf(params, "s[15]", SetCallSign)) return SendClientMessage(playerid, COLOR_ORANGE,"USAGE: /setcallsign [New Call Sign]");
    else
    {
        new Query[70]; format(Query, sizeof(Query), "UPDATE users SET CallSign = '%s' WHERE username = '%s'",PlayerInfo[playerid][CallSign],GetName(playerid));
        mysql_query(Query);
        new string[50];
        format(string,sizeof(string),"You have set your new Call Sign to - %s",SetCallSign) && SendClientMessage(playerid, COLOR_WHITE,string);
    }
    return 1;
}
Thanks in advance.
Reply
#2

Variable SetCallSign should be an array in command(setcallsign,playerid, params[])

pawn Код:
new SetCallSign[15];
Reply
#3

Cheers mick, should have though of that, works like a charm.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)