10.01.2012, 14:23
I get a mechanic job.And the mechanic job have a /neon command
When i type /neon
It show the list of colors.Then i choose red.It doesnt happen anything
When i type /neon
It show the list of colors.Then i choose red.It doesnt happen anything
pawn Код:
public AddVehicleNeon(playerid, vehicleid, neon)
{
new string[128];
// new sendername[32];
if(IsValidObject(Neon[vehicleid])) { DestroyObject(Neon[vehicleid]); Neon[vehicleid] = 0; }
if(IsValidObject(Neon2[vehicleid])) { DestroyObject(Neon2[vehicleid]); Neon2[vehicleid] = 0; }
if(IsValidObject(Neon3[vehicleid])) { DestroyObject(Neon3[vehicleid]); Neon3[vehicleid] = 0; }
if(IsValidObject(Neon4[vehicleid])) { DestroyObject(Neon4[vehicleid]); Neon4[vehicleid] = 0; }
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-2000; GivePlayerMoney(playerid,-2000);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger modifies the vehicle with neon.");
else format(string, sizeof(string), "* %s modifies the vehicle with neon.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
Neon[vehicleid] = CreateDynamicObject(neon, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
Neon2[vehicleid] = CreateDynamicObject(neon, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
if(GetVehicleModel(vehicleid) == 409) { Neon3[vehicleid] = CreateDynamicObject(neon, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); Neon4[vehicleid] = CreateDynamicObject(neon, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); }
switch (GetVehicleModel(vehicleid))
{
case 400: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.9, 0.0, -0.8, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.9, 0.0, -0.8, 0.0, 0.0, 0.0); }
case 401: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.9, 0.0, -0.6, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.9, 0.0, -0.6, 0.0, 0.0, 0.0); }
case 402: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.92, 0.0, -0.7, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.92, 0.0, -0.7, 0.0, 0.0, 0.0); }
case 404, 466, 467: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.55, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.55, 0.0, 0.0, 0.0); }
case 405, 442: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.7, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.7, 0.0, 0.0, 0.0); }
case 409: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 1.0, -0.6, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 1.0, -0.6, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon3[vehicleid], vehicleid, 0.8, -1.0, -0.6, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon4[vehicleid], vehicleid, -0.8, -1.0, -0.6, 0.0, 0.0, 0.0); }
case 410, 560: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.5, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.5, 0.0, 0.0, 0.0); }
case 411, 412, 415, 419, 458, 474: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.65, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.65, 0.0, 0.0, 0.0); }
case 413: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.85, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.85, 0.0, 0.0, 0.0); }
case 418: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.9, 0.0, -0.95, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.9, 0.0, -0.95, 0.0, 0.0, 0.0); }
case 420, 426, 429, 436: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.9, 0.0, -0.55, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.9, 0.0, -0.55, 0.0, 0.0, 0.0); }
case 421, 422: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.9, 0.0, -0.7, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.9, 0.0, -0.7, 0.0, 0.0, 0.0); }
case 424: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.85, 0.0, -0.5, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.85, 0.0, -0.5, 0.0, 0.0, 0.0); }
case 434: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.6, 0.0, -0.75, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.6, 0.0, -0.75, 0.0, 0.0, 0.0); }
case 438, 439: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.9, 0.0, -0.75, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.9, 0.0, -0.75, 0.0, 0.0, 0.0); }
case 440: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -1.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -1.0, 0.0, 0.0, 0.0); }
case 444: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.9, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.9, 0.0, 0.0, 0.0, 0.0, 0.0); }
case 445, 451, 475: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.6, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.6, 0.0, 0.0, 0.0); }
case 457: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.55, 0.0, -0.4, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.55, 0.0, -0.4, 0.0, 0.0, 0.0); }
case 459: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.8, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.8, 0.0, 0.0, 0.0); }
case 477, 480, 579, 580: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.6, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.6, 0.0, 0.0, 0.0); }
case 479, 541, 559, 565, 576, 598: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.5, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.5, 0.0, 0.0, 0.0); }
case 491, 534..536, 545, 587: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.65, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.65, 0.0, 0.0, 0.0); }
case 494, 502, 503, 540, 603: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.7, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.7, 0.0, 0.0, 0.0); }
case 495: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.9, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.9, 0.0, 0.0, 0.0); }
case 496, 518, 533, 566: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.55, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.55, 0.0, 0.0, 0.0); }
case 500: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.2, -0.6, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.2, -0.6, 0.0, 0.0, 0.0); }
case 506: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, -0.2, -0.55, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, -0.2, -0.55, 0.0, 0.0, 0.0); }
case 527: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.2, -0.5, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.2, -0.5, 0.0, 0.0, 0.0); }
case 550: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, -0.2, -0.7, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, -0.2, -0.7, 0.0, 0.0, 0.0); }
case 558, 589: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.45, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.45, 0.0, 0.0, 0.0); }
case 562: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.1, -0.5, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.1, -0.5, 0.0, 0.0, 0.0); }
case 567: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.2, -0.7, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.2, -0.7, 0.0, 0.0, 0.0); }
case 575: { AttachObjectToVehicle(Neon[vehicleid], vehicleid, 0.8, 0.0, -0.4, 0.0, 0.0, 0.0); AttachObjectToVehicle(Neon2[vehicleid], vehicleid, -0.8, 0.0, -0.4, 0.0, 0.0, 0.0); }
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/neon", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 7) { return SendClientMessage(playerid, COLOR_GREY, " You are not a Mechanic !"); }
if(!IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, " You are not in a vehicle !"); }
if(PlayerInfo[playerid][pCash] < 2000) { return SendClientMessage(playerid, COLOR_GREY, " You cant afford the neon !"); }
new vehicleid = GetPlayerVehicleID(playerid);
if(IsInvalidNeonVehicle(vehicleid))
{
return SendClientMessage(playerid, COLOR_GREY, " You cant mod this vehicle !");
}
DisplayDialogForPlayer(playerid, 101);
}
}