23.06.2012, 16:36
try to find: "public OnPlayerCommandText" on your mod, and put: "new tmp[128];" under it
like:
and replace the script with that:
rep if you find it useful
like:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new tmp[128];
pawn Код:
CMD:car(playerid, params[])
{
if(DMZone[playerid] == 0)
{
new string[256];
tmp = strtok(cmdtext, idx);
new car = GetVehicleModelIDFromName(tmp);
if(isnull(params))
return SendClientMessage(playerid, COLOR_GREY, "USAGE: /car [vehicleid|name] [color1] [color2]"), true;
new color1 = strval(tmp);
new color2 = strval(tmp);
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
X += (5 * floatsin(-A, degrees));
Y += (5 * floatcos(-A, degrees));
new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 600000000);
format(string, sizeof(string), "Vehicle %s(%d) spawned.", VehNames[GetVehicleModel(carid)-400], carid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
if(DMZone[playerid] == 1) return SendClientMessage(playerid, COLOR_RED,"ERROR: You are in a DM Zone");
return 1;
}