SA-MP Forums Archive
whats wrong - 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)
+--- Thread: whats wrong (/showthread.php?tid=556658)



whats wrong - BoU3A - 11.01.2015

PHP код:
CMD:aeject(playerid,params[])
{
  new 
TargetIDReason[100], name[24], tname[24], str[100];
  if(
pdata[playerid][Adminstator] < 2) return SendClientMessage(playerid,Red,"Command not found! Type /cmds");
  if(
sscanf(params"uS()[100])",TargetID,Reason)) return SendClientMessage(playerid,Red,"Eject player from vehicle: /aj <id> <reason>");
  if(!
IsPlayerConnected(TargetID)) return SendClientMessage(playerid,Red,"Player is not connected");
  if(!
IsPlayerInAnyVehicle(TargetID)) return SendClientMessage(playerid,Red,"Player is not in vehicle");
  {
    
GetPlayerName(playerid,name,sizeof(name));
    
format(str,sizeof(str),"%s %s ejected you: %s",AdminLevel(playerid),name,Reason);
    
SendClientMessage(TargetID,Red,str);
    
RemovePlayerFromVehicle(TargetID);
  } 
PHP код:
sscanf warning format specifier does not match parameter count 



Re: whats wrong - Sawalha - 11.01.2015

EDIT: didn't know your problem in previous topic, the guy under me fixed it, i guess.


Re: whats wrong - Threshold - 11.01.2015

Do not make another thread for the exact same code in your previous thread... it's just spamming and gets annoying.
https://sampforum.blast.hk/showthread.php?tid=556634

I see that you completely changed the code that I gave you, but that's okay... maybe you won't do it this time.
pawn Код:
CMD:aj(playerid, params[])
{
    if(pdata[playerid][Adminstator] < 2) return SendClientMessage(playerid, Red, "Command not found! Type /cmds");
    new TargetID, reason[65];
    if(sscanf(params, "uS( )[65]", TargetID, reason)) return SendClientMessage(playerid, Red, "Eject player from vehicle: /aj <id> <reason>");
    if(!IsPlayerConnected(TargetID)) return SendClientMessage(playerid, Red, "Player is not connected");
    if(!IsPlayerInAnyVehicle(TargetID)) return SendClientMessage(playerid, Red, "Player is not in vehicle");
    new name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, sizeof(name));
    format(str, sizeof(str), "%s %s ejected you: %s", AdminLevel(playerid), name, reason);
    SendClientMessage(TargetID, Red, str);
    RemovePlayerFromVehicle(TargetID);
    return 1;
}