/Gedit and /createpvehicle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /Gedit and /createpvehicle (
/showthread.php?tid=601179)
/Gedit and /createpvehicle -
CSLangdale - 17.02.2016
Hey I was wondering if anyone could help me with making these to cmds for my scripting
Re: /Gedit and /createpvehicle -
ikey07 - 17.02.2016
and what you want they do ?
Re: /Gedit and /createpvehicle -
CSLangdale - 17.02.2016
Sorry I missed that part out haha Gedit to create objects in game like gates and make them movable and createpvehicle to make a player vehicle so they can keep it instead of buying a vehicle in strcmp
Re: /Gedit and /createpvehicle -
XBrianX - 18.02.2016
Rep if it worked.
PHP код:
CMD:createpvehicle(playerid, params[])
{
// ur admin system here
new string[128], giveplayerid, modelid, color1, color2;
if(sscanf(params, "uddd", giveplayerid, modelid, color1, color2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createpvehicle [playerid/partofname] [modelid] [color 1] [color 2]");
if(color1 < 0 || color1 > 255) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 255!"); return 1; }
if(color2 < 0 || color2 > 255) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 255!"); return 1; }
if(modelid < 400 || modelid > 611) { SendClientMessage(playerid, COLOR_GREY, " Vehicle Number can't be below 400 or above 611!"); return 1; }
new playervehicleid = GetPlayerFreeVehicleId(giveplayerid);
new carsamount = GetPlayerVehicleCount(giveplayerid);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid,X,Y,Z);
new Float:Angle;
GetPlayerFacingAngle(giveplayerid,Angle);
new car = CreatePlayerVehicle(giveplayerid, playervehicleid, modelid, X, Y, Z, Angle, color1, color2, 0);
if(car == INVALID_PLAYER_VEHICLE_ID)
{
SendClientMessage(playerid, COLOR_GREY, "ERROR: Something went wrong and the car didn't get created.");
}
else
{
format(string, sizeof(string), " Vehicle successfully created with ID %d.", car);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
return 1;
}
Re: /Gedit and /createpvehicle -
-CaRRoT - 18.02.2016
Quote:
Originally Posted by XBrianX
Rep if it worked.
PHP код:
CMD:createpvehicle(playerid, params[])
{
// ur admin system here
new string[128], giveplayerid, modelid, color1, color2;
if(sscanf(params, "uddd", giveplayerid, modelid, color1, color2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createpvehicle [playerid/partofname] [modelid] [color 1] [color 2]");
if(color1 < 0 || color1 > 255) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 255!"); return 1; }
if(color2 < 0 || color2 > 255) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 255!"); return 1; }
if(modelid < 400 || modelid > 611) { SendClientMessage(playerid, COLOR_GREY, " Vehicle Number can't be below 400 or above 611!"); return 1; }
new playervehicleid = GetPlayerFreeVehicleId(giveplayerid);
new carsamount = GetPlayerVehicleCount(giveplayerid);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid,X,Y,Z);
new Float:Angle;
GetPlayerFacingAngle(giveplayerid,Angle);
new car = CreatePlayerVehicle(giveplayerid, playervehicleid, modelid, X, Y, Z, Angle, color1, color2, 0);
if(car == INVALID_PLAYER_VEHICLE_ID)
{
SendClientMessage(playerid, COLOR_GREY, "ERROR: Something went wrong and the car didn't get created.");
}
else
{
format(string, sizeof(string), " Vehicle successfully created with ID %d.", car);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
return 1;
}
|
I suppose "CreatePlayerVehicle" and "GetPlayerFreeVehicleID" functions are gonna create them self? How about you not copy/paste without a single clue on how stuff works?
@OP - What you're requesting are full dynamic systems, no one is gonna code a whole system just to post it here. There are alot of similar stuff that have been already released as filter scripts, check them out in the filterscripts section.
Here are some examples from a quick search:
http://forum.sa-mp.com/showthread.ph...t=dynamic+gate
http://forum.sa-mp.com/showthread.ph...Vehicle+System