Making one command multi -
dillo1000 - 09.05.2015
I don't really know how to search for something like this when I do not know the name?
How do I make this I think a string?
For example /resetcar 1-4
pawn Код:
CMD:resetcar(playerid,params[])
{
if(IsMuted(playerid))return 1;
new id,Float:x,Float:y,Float:z,str[128];
if(AdminLevel[playerid]<3)return 0;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,GREY,"USAGE: /resetcar [playerid]");
if(Car[id]==0)return SendClientMessage(playerid,GREY,"That player doesn't own any car");
GetPlayerPos(id,x,y,z);
SetVehiclePos(Car[id],x,y+2,z);
LinkVehicleToInterior(Car[id],GetPlayerInterior(playerid));
SetVehicleVirtualWorld(Car[id],0);
if(id!=playerid)
{
format(str,sizeof(str),"You have reset the vehicle position of %s's personal vehicle",PlayerName(id));
SendClientMessage(playerid,YELLOW,str);
SendClientMessage(id,YELLOW,"An Administrator has reset your personal vehicle's position");
}
if(id==playerid)
{
SendClientMessage(id,YELLOW,"You have reset your personal vehicle's position");
}
return 1;
}
Re: Making one command multi -
Smileys - 09.05.2015
The way it is now you can already use IDs, like 0, 1, 2 etc. integer values AND strings.
if you wish to use integer values only, use "i", if string only use "s[character_limit]".
Re: Making one command multi -
PSYCHOBABYKILLA - 09.05.2015
sorry im no pro but i think he meant something like this in a dcmd version i forgot how to do it in zmd
dcmd_bomball(playerid,params[])
#pragma unused params
{
dcmd_bomb1(playerid, params);
dcmd_bomb2(playerid, params);
dcmd_bomb3(playerid, params);
dcmd_bomb4(playerid, params);
dcmd_bomb5(playerid, params);
return true;
}
something like this?