28.01.2011, 02:22
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.
Thanks in advance.
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;
}