15.07.2013, 03:51
I use this , If you entered the CheckPoint it make what in the code
the Problem that it appear many selections and it bug everything , and i can't choose any weapon
PHP код:
if(getCheckpointType(playerid) == CP_WEAPS)
{
ShowModelSelectionMenu(playerid, gunlist2, "Select Gun");
return 1;
}
PHP код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == gunlist2)
{
if(response)
{
switch(modelid)
{
case 331:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 1, 100); // Brass Knuckles //////////////
GivePlayerMoney(playerid,-500);
return 1;
}
case 333:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 2, 100); // Golf Club ///////////////
GivePlayerMoney(playerid,-500);
return 1;
}
case 335:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 4, 100); // Knife ///////////
GivePlayerMoney(playerid,-500);
return 1;
}
case 336:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 5, 100); // Baseball Bat /////////
GivePlayerMoney(playerid,-500);
return 1;
}
case 337:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 6, 100); // Shovel ////////
GivePlayerMoney(playerid,-500);
return 1;
}
case 338:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 7, 100); // Pool Cue//////
GivePlayerMoney(playerid,-500);
return 1;
}
case 339:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 8, 100); // Katana ///////
GivePlayerMoney(playerid,-500);
return 1;
}
case 341:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 9, 100); // Chainsaw /////
GivePlayerMoney(playerid,-500);
return 1;
}
case 321:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 10, 100); // Double-ended Dildo //////////////////
GivePlayerMoney(playerid,-500);
return 1;
}
case 325:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 14, 100); // Flowers //////////////////
GivePlayerMoney(playerid,-500);
return 1;
}
case 326:
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 500)
{
GivePlayerWeapon(playerid, 15, 100); // Cane ////////////////
GivePlayerMoney(playerid,-500);
return 1;
}
case 346:
if(GetPlayerMoney(playerid) < 1000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 1000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 1000)
{
GivePlayerWeapon(playerid, 22, 100); // 9mm ////////////
GivePlayerMoney(playerid,-1000);
return 1;
}
case 347:
if(GetPlayerMoney(playerid) < 1500)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 1500$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 1500)
{
GivePlayerWeapon(playerid, 23, 100); // Silenced 9mm /////////
GivePlayerMoney(playerid,-1500);
return 1;
}
case 348:
if(GetPlayerMoney(playerid) < 4000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 4000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 4000)
{
GivePlayerWeapon(playerid, 24, 100); // Desert Eagle///////
GivePlayerMoney(playerid,-4000);
return 1;
}
case 349:
if(GetPlayerMoney(playerid) < 2000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 2000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 2000)
{
GivePlayerWeapon(playerid, 25, 100); // Shotgun/////////
GivePlayerMoney(playerid,-2000);
return 1;
}
case 350:
if(GetPlayerMoney(playerid) < 3000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 3000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 3000)
{
GivePlayerWeapon(playerid, 26, 100); // Sawnoff///////////
GivePlayerMoney(playerid,-3000);
return 1;
}
case 351:
if(GetPlayerMoney(playerid) < 2000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 2000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 2000)
{
GivePlayerWeapon(playerid, 27, 100); // Combat Shotgun///////////
GivePlayerMoney(playerid,-2000);
return 1;
}
case 352:
if(GetPlayerMoney(playerid) < 1000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 1000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 1000)
{
GivePlayerWeapon(playerid, 28, 100); // Micro SMG/Uzi//////////
GivePlayerMoney(playerid,-1000);
return 1;
}
case 353:
if(GetPlayerMoney(playerid) < 3000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 3000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 3000)
{
GivePlayerWeapon(playerid, 29, 100); // MP5////////////
GivePlayerMoney(playerid,-3000);
return 1;
}
case 355:
if(GetPlayerMoney(playerid) < 4000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 4000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 4000)
{
GivePlayerWeapon(playerid, 30, 100); // AK-47////////////
GivePlayerMoney(playerid,-4000);
return 1;
}
case 356:
if(GetPlayerMoney(playerid) < 5000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 5000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 5000)
{
GivePlayerWeapon(playerid, 31, 100); // M4////////////
GivePlayerMoney(playerid,-5000);
return 1;
}
case 372:
if(GetPlayerMoney(playerid) < 1000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 1000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 1000)
{
GivePlayerWeapon(playerid, 32, 100); // Tec-9/////////
GivePlayerMoney(playerid,-1000);
return 1;
}
case 357:
if(GetPlayerMoney(playerid) < 2000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 2000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 2000)
{
GivePlayerWeapon(playerid, 33, 100); // Country Rifle////////////
GivePlayerMoney(playerid,-2000);
return 1;
}
case 358:
if(GetPlayerMoney(playerid) < 3000)
{
SendClientMessage(playerid,COLOR_ERROR,"You need 3000$ to buy this weapon");
return 1;
}
else if(GetPlayerMoney(playerid) >= 3000)
{
GivePlayerWeapon(playerid, 34, 100); // Sniper Rifle///////////
GivePlayerMoney(playerid,-3000);
return 1;
}
}
SendClientMessage(playerid, COLOR_DODGERBLUE, "The weapon is selected!");
}
else SendClientMessage(playerid, COLOR_DODGERBLUE, "You cancelled a weapon choice!");
return 1;
}
return 1;
}