/asay <message>", "Admin-chat (this allows admins to chat privately)"},
{1, "/bike", "Spawns a bike of your choice"},
{1, "/boat", "Spawns a boat of your choice"},
{1, "/car", "Spawns a car of your choice"},
{1, "/endspec", "Stop spectating a player"},
{1, "/engine <EngineStatus (0/1)>", "Toggle engine-status on or off"},
{1, "/freeze <OtherPlayer> <Duration> <Reason>", "Freeze a player for a certain time in seconds"},
{1, "/fuel", "Refuels your vehicle for free"},
{1, "/get <OtherPlayer>", "Teleports another player to your location"},
{1, "/jail <PlayerToJail> <JailTime> <Reason>", "Jails another player for a certain time in seconds"},
{1, "/kick <PlayerToKick> <Reason>", "Kick a player"},
{1, "/mute <OtherPlayer> <Reason>", "Mute a player"},
{1, "/mutes", "Display muted players"},
{1, "/nos", "Adds nitro to your vehicle"},
{1, "/plane", "Spawns a plane of your choice"},
{1, "/port <OtherPlayer>", "Teleport yourself to another player"},
{1, "/portloc <x> <y> <z>", "Teleport yourself to the given coordinates"},
{1, "/portvehicle <CarID>", "Teleport yourself to a vehicle"},
{1, "/rep", "Show the last 50 reports in a dialog"},
{1, "/repair", "Repairs your vehicle for free"},
{1, "/respawn <Vehicle-id>", "Forces a vehicle to respawn"},
{1, "/spec <OtherPlayer>", "Spectate a player"},
{1, "/tele <PlayerToPort> <TargetPlayer>", "Teleport a player to another player"},
{1, "/trailer", "Spawns a trailer of your choice"},
{1, "/unmute <OtherPlayer>", "Un-mutes a player"},
{1, "/warn <PlayerToWarn> <Reason>", "Warn a player, up to three times"},
{2, "/eject <OtherPlayer>", "Ejects a player from his vehicle"},
{2, "/wanted <PlayerID> <Stars>", "Set a player's wanted level"},
{3, "/ban <PlayerToBan> <Days> <Hours> <Reason>", "Ban a player for a certain time"},
{3, "/caroption", "Changes some options for your vehicle"},
{3, "/cleanupcars", "Removes all spawned vehicles from the map"},
{3, "/fly", "Equips yourself with a jetpack"},
{3, "/healall", "Heals all the players"},
{3, "/ipban <PlayerToBan> <Reason>", "Ban a player's IP"},
{3, "/loc", "Display your current location"},
{3, "/plate <NumberPlate>", "Changes the plate on your vehicle"},
{3, "/rangeban <PlayerToBan> <Reason>", "Ban a player's entire IP-range"},
{3, "/repairall", "Repair all vehicles for free"},
{3, "/setscore <OtherPlayer> <Score>", "Sets another player's score to the given value"},
{3, "/unban <PlayerToUnban>", "Unban a player"},
{4, "/cash <amount>", "Give cash to yourself"},
{4, "/score <amount>", "Give scorepoints to yourself"},
{4, "/setskin <skin-id (0-299)>", "Lets an admin choose another skin"},
{4, "/weather", "Changes the weather"},
{5, "/clamp <vehicleid> <reason>", "Delete a player-owned vehicle"},
{5, "/createbusiness", "Create a business at your location"},
{5, "/createcamera <max_speed>", "Create s speedcamera at your location"},
{5, "/createhouse <price> <maxlevel (1-10)>", "Create a new house"},
{5, "/delbusiness", "Delete a business"},
{5, "/delcamera", "Delete a speedcamera"},
{5, "/delhouse", "Delete a house"},
{5, "/delobject <ObjectID>", "Deletes an object"},
{5, "/delvehicle <VehicleID>", "Deletes a vehicle"},
{5, "/fixplayer <OtherPlayer>", "Fix a player's property (re-add his houses and buinesses)"},
{5, "/object <ObjectModel> <x> <y> <z> <Angle>", "Create an object"},
{5, "/pickup <PickupModel> <x> <y> <z> <PickupType>", "Create a pickup"},
{5, "/resetplayer <OtherPlayer> <Money (0/1)> <Score (0/1)> <Stats (0/1)> <Reason>", "Reset a player's money, score, stats"},
{5, "/restart", "Restarts the server in 2 minutes"},
{5, "/saveloc <ID> <LocationName>", "Saves your location to a file"},
{5, "/setlevel <OtherPlayer> <AdminLevel>", "Changes a player's admin-level"},
{5, "/vehicle <VehicleModel> <x> <y> <z> <Angle> <SpawnDelay>",
CMD:get(playerid, params[])
{
new getid; //creates the variable that we're going to be using to represent the param in sscanf
if(IsPlayerAdmin(playerid)) //checks if they're logged into RCON
{
new str[50], getname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME]; //creates name vars n a string
new Float:x, Float:y, Float:z; //creates new variables so we can store the positions
if(sscanf(params, "u", getid)) return SendClientMessage(playerid, COLOR_RED,"USAGE: /get <playerid>"); //checks if the entered param is a playerid/name, if not sends the usage.
if(IsPlayerAdmin(getid)) return SendClientMessage(playerid, COLOR_RED,"You can't get an admin."); //checks if the other player is an admin. if not, sends an error message.
GetPlayerName(playerid, name, sizeof(name)); //gets name of the user
GetPlayerName(getid, getname, sizeof(getname)); //gets name of the other player
GetPlayerPos(playerid, x,y,z); //gets the players pos
SetPlayerPos(getid, x+3,y,z); //sets the other players pos
format(str,sizeof(str), "You have gotten %s", getname); //formats the message so we can send it
SendClientMessage(playerid, COLOR_RED, str); //sends the message to the player who typed it
format(str,sizeof(str), "%s has gotten you.", name); //formats the message so we can send it
SendClientMessage(getid, COLOR_RED, str); //sends the message to the other player
}
return 1;
}
CMD:acmds(playerid, params[])
{
new string[128],msg[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(sscanf(params,"sz",msg)) return SendClientMessage(playerid,COLOR_RED, "
{1, "/asay, /bike, /boat, /car, /endspec
{1, "/endspec",
{1, "/engine <EngineStatus (0/1)>",
{1, "/freeze <OtherPlayer> <Duration> <Reason>",
{1, "/fuel",
{1, "/get <OtherPlayer>",
{1, "/jail <PlayerToJail> <JailTime> <Reason>",
{1, "/kick <PlayerToKick> <Reason>",
{1, "/mutes",
{1, "/nos",
{1, "/plane",
{1, "/port <OtherPlayer>",
{1, "/portloc <x> <y> <z>",
{1, "/portvehicle <CarID>",
{1, "/rep",
{1, "/repair",
{1, "/respawn <Vehicle-id>",
{1, "/spec <OtherPlayer>",
{1, "/tele <PlayerToPort> <TargetPlayer>",
{1, "/trailer",
{1, "/unmute <OtherPlayer>",
{1, "/warn <PlayerToWarn> <Reason>",
{2, "/eject <OtherPlayer>",
{2, "/wanted <PlayerID> <Stars>",
{3, "/ban <PlayerToBan> <Days> <Hours> <Reason>",
{3, "/caroption",
{3, "/cleanupcars",
{3, "/fly",
{3, "/healall",
{3, "/ipban <PlayerToBan> <Reason>",
{3, "/loc",
{3, "/plate <NumberPlate>",
{3, "/rangeban <PlayerToBan> <Reason>",
{3, "/repairall",
{3, "/setscore <OtherPlayer> <Score>",
{3, "/unban <PlayerToUnban>",
{4, "/cash <amount>",
{4, "/score <amount>",
{4, "/setskin <skin-id (0-299)>",
{4, "/weather",
{5, "/clamp , /vehicle, /createbusiness, /createcamera, /createhouse, /delbusiness,"
{5, "/delcamera
{5, "/delhouse",
{5, "/delobject <ObjectID>",
{5, "/delvehicle <VehicleID>",
{5, "/fixplayer <OtherPlayer>",
{5, "/object <ObjectModel> <x> <y> <z> <Angle>",
{5, "/pickup <PickupModel> <x> <y> <z> <PickupType>",
{5, "/resetplayer <OtherPlayer> <Money (0/1)> <Score (0/1)> <Stats (0/1)> <Reason>",
{5, "/restart",
{5, "/saveloc <ID> <LocationName>",
{5, "/setlevel <OtherPlayer> <AdminLevel>",
{5, "/vehicle <VehicleModel> <x> <y> <z> <Angle> <SpawnDelay>", ");
SendClientMessageToPlayer(COLOR_White,string);
if(sscanf(params,"sz",msg) == 0)
Yeah sscanf() needs to equal 0 for it to be successful.
So change it to pawn Код:
|
It sorta looks like your attempting to format a string inside SendClientMessage, which will never work.
|