Need Help
#1

Sorry guyz for asking this shity question btw i am start scripting so I need to know something,

i want add a cmd from filterscript and put it to the gm so how ? and in gm where? which line down i need put? can u tell me?

example this is a cmd

CMD:goto(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You need to be RCON for use this command");
new ID;
new pn[MAX_PLAYER_NAME];
new an[MAX_PLAYER_NAME];
new str[128];
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /goto [ID]"); //This is a long line, "sscanf" is the plugin that search the missing params, "params" is the param that define params LOL, "u" is the PARAM that define the MISSING ID, ID is the param for the targetid
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: This player is not connected");//Same as !IsPlayerAdmin, but instead of "playerid" we put "ID" because it's the targetid
GetPlayerName(playerid, an, MAX_PLAYER_NAME);//Define the playerid's param
GetPlayerName(ID, pn, MAX_PLAYER_NAME);//Define the ID's param
new Float; //Defining float X
new Float:y; //Same
new Float:z; //Same
GetPlayerPos(ID, x, y, z); //This line get the "ID" position
SetPlayerPos(playerid, x+1, y+1, z); //This line set the "playerid" position from "ID" position, with some changes(x+1, y+1);
format(str, sizeof(str), "You have been teleported to %s", pn); //Showed before, this is the line that give the message to playerid)
SendClientMessage(playerid, 0x00FF00AA, str); //This line give the message to playerid
if(IsPlayerInAnyVehicle(playerid)) //Mhh, let's give you a question, what should this callback do?
{
GetPlayerPos(ID, x, y, z);
SetVehiclePos(playerid, x+1, y+1, z); //And this one?
}
return 1;
}
Reply
#2

You need to use ZCMD and sscanf (****** them to download the latest versions). And you should use all your commands with ZCMD and not inside any callback. NO matter where it is, unless it's inside a callback that it's going to give errors.

PS: You cannot have commands with ZCMD and others in OnPlayerCommandText and work perfect.
Reply
#3

Use [ pawn ][ /pawn ] tag on your script.
Just CTRL+F "CMD" and add the script on above the "CMD" lines.
and add what include needed.
Reply
#4

As Dwane said, make sure you are not putting it under ANY CALLBACKS like OnSomethingSomething! The best way, just put it at the bottom-most line of your script! (make sure your script compiles fine before pasting it there)
Reply
#5



see this pic and see did i put it right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)