Szerző Téma: parancs átírása  (Megtekintve 426 alkalommal)

Nem elérhető inf

  • 366
    • Profil megtekintése
parancs átírása
« Dátum: 2013. október 08. - 16:51:53 »
0 Show voters
Sziasztok!
Valaki ezt a scriptet át tudná nekem írni úgy hogy ne sscanf-al legyen használva?
Itt a script:
 
dcmd_pm(playerid,params[])
{
new OtherPlayer, Message[128], Msg1[128], Msg2[128], YourName[24], OtherPlayerName[24];
if (sscanf(params, \"us[128]\", OtherPlayer, Message)) SendClientMessage(playerid, 0xFF0000AA, \"Használat: /pm [Játékos] [Üzenet]\");
if (IsPlayerConnected(OtherPlayer))
{
GetPlayerName(playerid, YourName, sizeof(YourName));
GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
format(Msg1, 128, \"%s >>> %s : %s\", YourName, OtherPlayerName, Message);
format(Msg2, 128, \"%s >>> %s : %s\", YourName, OtherPlayerName, Message);
SendClientMessage(playerid, 0xFFFFFFFF, Msg1);
SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg2);
}
else
SendClientMessage(playerid, 0xFF0000FF, \"Player is not online\");
return 1;
}

 
Ilyenné kellene átírni mit ez:
 
dcmd_screen(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 2) {
    new tmp[256], tmp2[256], Index;      tmp = strtok(params,Index), tmp2 = strtok(params,Index);
    if(!strlen(params)) return SendClientMessage(playerid, red, \"USAGE: /screen [playerid] [text]\");
       new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(params);
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
   GetPlayerName(player1, playername, sizeof(playername));      GetPlayerName(playerid, adminname, sizeof(adminname));
   CMDMessageToAdmins(playerid,\"SCREEN\");
   format(string,sizeof(string),\"Administrator %s has sent you a screen message\",adminname);   SendClientMessage(player1,blue,string);
   format(string,sizeof(string),\"You have sent %s a screen message (%s)\", playername, params[2]); SendClientMessage(playerid,blue,string);
   return GameTextForPlayer(player1, params[2],4000,3);
} else return SendClientMessage(playerid, red, \"Player is not connected or is yourself or is the highest level admin\");
} else return SendClientMessage(playerid,red,\"ERROR: You are not a high enough level to use this command\");
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal