28.02.2015, 21:01
(
Последний раз редактировалось RedCode; 08.03.2015 в 19:56.
Причина: Delete
)
Deleted
;CMD:buyrims(playerid, params[])
{
if(PlayerInfo[playerid][pLevel] >= 1)
{
/*if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid,COLOR_WHITE, "You aren't ON-DUTY.");
return 1;
}*/
if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessageEx(playerid, COLOR_GRAD1, " You are not in the vehicle / You are not the driver");
{
new iPlayer = -1, iVeh;
foreach(Player, i)
{
iPlayerVeh = GetPlayerVehicle(i, iVeh);
if(iPlayerVeh != -1)
{
if(i != playerid) return SendClientMessage(playerid,COLOR_GREY,"You cannot change rims of vehicles that do not belong to you.");
}
}
if(iPlayerVeh == -1) return SendClientMessage(playerid, COLOR_GREY, "You cannot change rims of vehicles that do not belong to you.")
new string[128], rims;
if(sscanf(params, "d", rims))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USE: /buyrims [rimsid]");
SendClientMessageEx(playerid, COLOR_GRAD4, "|1 Cutter |2 Shadow |3 Rimshine |4 Wires |5 Classic |6 Twist");
SendClientMessageEx(playerid, COLOR_GRAD2, "|7 Gold Rims |8 Dollar |9 Grove |10 Import ");
SendClientMessageEx(playerid, COLOR_ORANGE, " Be sure to have $30000 in hand to buy rims for your vehicle");
return 1;
}
switch (rims)
{
case 1:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1079);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 2:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1073);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 3:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1075);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 4:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1076);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 5:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1077);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 6:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1078);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 7:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 8:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1083);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 9:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1081);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 10:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1082);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
default:
{
format(string, sizeof(string), " Invalid rims", rims);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You can't use this command!");
}
return 1;
}
|
maramizo i will test it
error 001: expected token: ";", but found "new" Code : new string[128], rims; if(sscanf(params, "d", rims)) |
CMD:buyrims(playerid, params[])
{
if(PlayerInfo[playerid][pLevel] >= 1)
{
/*if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid,COLOR_WHITE, "You aren't ON-DUTY.");
return 1;
}*/
if(!IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessageEx(playerid, COLOR_GRAD1, " You are not in the vehicle / You are not the driver");
{
new iPlayer = -1, iVeh;
foreach(Player, i)
{
iPlayerVeh = GetPlayerVehicle(i, iVeh);
if(iPlayerVeh != -1)
{
if(i != playerid) return SendClientMessage(playerid,COLOR_GREY,"You cannot change rims of vehicles that do not belong to you.");
}
}
if(iPlayerVeh == -1) return SendClientMessage(playerid, COLOR_GREY, "You cannot change rims of vehicles that do not belong to you.");
new string[128], rims;
if(sscanf(params, "d", rims))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USE: /buyrims [rimsid]");
SendClientMessageEx(playerid, COLOR_GRAD4, "|1 Cutter |2 Shadow |3 Rimshine |4 Wires |5 Classic |6 Twist");
SendClientMessageEx(playerid, COLOR_GRAD2, "|7 Gold Rims |8 Dollar |9 Grove |10 Import ");
SendClientMessageEx(playerid, COLOR_ORANGE, " Be sure to have $30000 in hand to buy rims for your vehicle");
return 1;
}
switch (rims)
{
case 1:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1079);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 2:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1073);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 3:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1075);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 4:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1076);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 5:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1077);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 6:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1078);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 7:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 8:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1083);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 9:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1081);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
case 10:
{
if (GetPlayerCash(playerid) >= 30000)
{
GivePlayerCash(playerid, -30000);
AddVehicleComponent(GetPlayerVehicleID(playerid), 1082);
SendClientMessageEx(playerid, COLOR_GRAD1, "Enjoy the new Rims to your vehicle ");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, " You don't have cash to buy this rims");
}
}
default:
{
format(string, sizeof(string), " Invalid rims", rims);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You can't use this command!");
}
return 1;
}