Posts: 33
Threads: 9
Joined: Oct 2009
Reputation:
0
Hey guys, so i'm recently using a Zgaming Script Edited by my own, but the issue is that i dont have any experience with making own commands and such, so i'd like to ask someone a method of how to make one, for example /givecar as i know you'd have to make a Command thats also Editing the .ini file of the player.
If you guys can help me out that would be awesome since i'm trying to do it for my own for ages now Heh,
Thanks.
Posts: 33
Threads: 9
Joined: Oct 2009
Reputation:
0
Thanks alot, but is there also a Command which makes you able to set the colors aswell? So for example, /givecat [Vehicle ID] [Color1] [Color2]
Posts: 33
Threads: 9
Joined: Oct 2009
Reputation:
0
I'll check when im at home if it worked, if it will work ill +Rep you.
Posts: 33
Threads: 9
Joined: Oct 2009
Reputation:
0
Having these errors,
G:\UK-RP\gamemodes\UKRP.pwn(4788 ) : error 017: undefined symbol "Player"
G:\UK-RP\gamemodes\UKRP.pwn(4788 ) : warning 215: expression has no effect
G:\UK-RP\gamemodes\UKRP.pwn(4788 ) : error 001: expected token: ";", but found "]"
G:\UK-RP\gamemodes\UKRP.pwn(4788 ) : error 029: invalid expression, assumed zero
G:\UK-RP\gamemodes\UKRP.pwn(4788 ) : fatal error 107: too many error messages on one line
Posts: 4
Threads: 1
Joined: Sep 2014
Код:
CMD:givecar(playerid,params[])
{
new carid;
new id;
new Float:X, Float:Y, Float:Z, Float:angle;
new string[160];
if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "You are Not Allowed To Use This Command!");
if(sscanf(params,"du",id, carid)) return SendClientMessage(playerid,COLOR_ORANGE,"Usage: /givecar [playerid] [carid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This Player is Not Connected!");
if(carid < 400 || carid > 611) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Vehicle Model!");
GetPlayerPos(id, X, Y, Z);
GetPlayerFacingAngle(id, angle);
CreateVehicle(carid, X, Y, Z, angle, 0, 1, 60);
PutPlayerInVehicle(id, carid, 0);
format(string, sizeof(string), "[INFO]: Administrator %s Has Spawned a Vehicles id %d To %s.", GetName(playerid), carid, GetName(id));
SendClientMessageToAll(COLOR_PURPLE, string);
return 1;
}
Change this :
Код:
if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2
with what level do you want ! If doesn.t woring , try with your Admin variable !