Commands Problem
#1

when i use it they only detect id 0 when i /do /rickroll 1 or 2 or whatevery they show

(0) has been rickroll. even i don't see name too. it's simple mistake but ia m busy on another scripting pls fix it. if u can.

PHP код:
CMD:rickroll(playeridparams[])
{
        new 
Playerid3str[128];
        if(
PlayerInfo[playerid][aLevel] < 2) return SendClientMessage(playeridRED"Invalid command. Type /cmds to see a list of available commands.");
        if(!
IsPlayerConnected(Playerid3)) return SendClientMessage(playeridRED"Player is not connected!");
        if(
sscanf(params"us[64]"Playerid3)) return SendClientMessage(playeridRED"USAGE: /rickroll [playerid]");
        {
            
format(strsizeof(str), "%s (%d) has been Rick-Rolled."Playerid3ID); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
            
SendClientMessageToAll(COLOR_MAGENTAstr); //Send the message we formatted with format using the str variable we declared/made.
            
format(strsizeof(str), "Never Gonna Give You Up, Never Gonna Let You Down,"); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
            
SendClientMessage(playeridLIGHTGREENstr);
            
format(strsizeof(str), "Never Gonna Run Around And Desert You!"); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
            
SendClientMessage(playeridLIGHTGREENstr);
            
format(strsizeof(str), "Never Gonna Make You Cry, Never Gonna Say GoodBye,"); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
            
SendClientMessage(playeridLIGHTGREENstr);
            
format(strsizeof(str), "Never Gonna Tell A Lie And Hurt You!"); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
            
SendClientMessage(playeridLIGHTGREENstr);
            
format(strsizeof(str), "You have been Rick-Rolled."); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
            
SendClientMessage(playeridCOLOR_MAGENTAstr);
            return 
1;
        }

Reply
#2

pawn Код:
sscanf(params, "us[64]", Playerid3)
You are retrieving only the user id, the second parameter is not present. Use GetPlayerName to get his username. Also change your playerid to Playerid3 so the message is sent to the target, not the player executing command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)