PHP код:
if(strcmp(cmd, "/pickpocket", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pickpocket [Playerid/PartOfName]");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Cannot use this while in a Car !");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(ProxDetectorS(5.0, playerid, giveplayerid))
{
if(pCD[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You have to wait 30 seconds to pickpocket again !");
return 1;
}
else
{
new name[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, name2, sizeof(name2));
GetPlayerName(playerid, name, sizeof(name));
ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0); // Deal
format(string, sizeof(string), "%s Attempt to pickpocket %s", name, name2);
SendClientMessage(playerid, COLOR_PURPLE, string);
SetTimer("Pickpocketed",2000,true);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
return 1;
}
}
}
return 1;
}
PHP код:
if(dialogid == 680) // Pickpocket
{
new string[128];
new tmp[128];
new giveplayerid;
new name[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, name2, sizeof(name2));
GetPlayerName(playerid, name, sizeof(name));
giveplayerid = ReturnUser(tmp);
if(response)
{
if(listitem == 0) // Cash
{
if(PlayerInfo[playerid][pPocketL] == 1)
{
if(PlayerInfo[giveplayerid][pCash] < 199)
{
format(string, sizeof(string),"* There is nohing you can rob from %s",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!ProxDetectorS(5.0, playerid, giveplayerid))
{
format(string, sizeof(string),"* %s Moved from their spot!",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!IsPlayerConnected(Pickpocket[playerid]))
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline");
return 1;
}
if(Pickpocket[giveplayerid] == 1)
{
new cash = 200 + random(900);
PlayerInfo[giveplayerid][pCash] = PlayerInfo[playerid][pCash]-cash;
GivePlayerMoney(giveplayerid, - cash);
PlayerInfo[playerid][pCash] = PlayerInfo[giveplayerid][pCash]+cash;
GivePlayerMoney(playerid, cash);
PlayerInfo[playerid][pPocketX] -= 1;
format(string, sizeof(string),"* You robbed $%d From %s!",cash,name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string),"* %s robbed $%d From you!",name, cash);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
pCD[playerid] = 1;
SetTimer("Unsetpickpocket",30000,true);
}
}
else if(PlayerInfo[playerid][pPocketL] == 2)
{
if(PlayerInfo[giveplayerid][pCash] < 999)
{
format(string, sizeof(string),"* There is nohing you can rob from %s",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!ProxDetectorS(5.0, playerid, giveplayerid))
{
format(string, sizeof(string),"* %s Moved from their spot!",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!IsPlayerConnected(Pickpocket[playerid]))
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline");
return 1;
}
if(Pickpocket[giveplayerid] == 1)
{
new cash = 1000 + random(1900);
PlayerInfo[giveplayerid][pCash] = PlayerInfo[playerid][pCash]-cash;
GivePlayerMoney(giveplayerid, - cash);
PlayerInfo[playerid][pCash] = PlayerInfo[giveplayerid][pCash]+cash;
GivePlayerMoney(playerid, cash);
PlayerInfo[playerid][pPocketX] -= 1;
format(string, sizeof(string),"* You robbed $%d From %s!",cash,name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string),"* %s robbed $%d From you!",name, cash);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
pCD[playerid] = 1;
SetTimer("Unsetpickpocket",30000,true);
}
}
else if(PlayerInfo[playerid][pPocketL] == 3)
{
if(PlayerInfo[giveplayerid][pCash] < 1999)
{
format(string, sizeof(string),"* There is nohing you can rob from %s",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!ProxDetectorS(5.0, playerid, giveplayerid))
{
format(string, sizeof(string),"* %s Moved from their spot!",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!IsPlayerConnected(Pickpocket[playerid]))
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline");
return 1;
}
if(Pickpocket[giveplayerid] == 1)
{
new cash = 2000 + random(2900);
PlayerInfo[giveplayerid][pCash] = PlayerInfo[playerid][pCash]-cash;
GivePlayerMoney(giveplayerid, - cash);
PlayerInfo[playerid][pCash] = PlayerInfo[giveplayerid][pCash]+cash;
GivePlayerMoney(playerid, cash);
format(string, sizeof(string),"* You robbed $%d From %s!",cash,name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string),"* %s robbed $%d From you!",name, cash);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
pCD[playerid] = 1;
SetTimer("Unsetpickpocket",30000,true);
}
}
}
if(listitem == 1) // Crack
{
if(PlayerInfo[playerid][pPocketL] == 1)
{
if(PlayerInfo[giveplayerid][pCrack] < 1)
{
format(string, sizeof(string),"* There is nohing you can rob from %s",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!ProxDetectorS(5.0, playerid, giveplayerid))
{
format(string, sizeof(string),"* %s Moved from their spot!",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!IsPlayerConnected(Pickpocket[playerid]))
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline");
return 1;
}
new crack = 1 + random(10);
PlayerInfo[giveplayerid][pCrack] = PlayerInfo[playerid][pCrack]-crack;
PlayerInfo[playerid][pCrack] = PlayerInfo[giveplayerid][pCrack]+crack;
PlayerInfo[playerid][pPocketX] -= 1;
format(string, sizeof(string),"* You robbed %d gram crack From %s!",crack,name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string),"* %s robbed %d gram From you!",name, crack);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
pCD[playerid] = 1;
SetTimer("Unsetpickpocket",30000,true);
}
else if(PlayerInfo[playerid][pPocketL] == 2)
{
if(PlayerInfo[giveplayerid][pCrack] < 9)
{
format(string, sizeof(string),"* There is nohing you can rob from %s",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!ProxDetectorS(5.0, playerid, giveplayerid))
{
format(string, sizeof(string),"* %s Moved from their spot!",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!IsPlayerConnected(Pickpocket[playerid]))
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline");
return 1;
}
new crack = 10 + random(20);
PlayerInfo[giveplayerid][pCrack] = PlayerInfo[playerid][pCrack]-crack;
PlayerInfo[playerid][pCrack] = PlayerInfo[giveplayerid][pCrack]+crack;
PlayerInfo[playerid][pPocketX] -= 1;
PlayerInfo[playerid][pPocketX] -= 1;
format(string, sizeof(string),"* You robbed %d gram crack From %s!",crack,name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string),"* %s robbed %d gram From you!",name, crack);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
pCD[playerid] = 1;
SetTimer("Unsetpickpocket",30000,true);
}
else if(PlayerInfo[playerid][pPocketL] == 3)
{
if(PlayerInfo[giveplayerid][pCrack] < 19)
{
format(string, sizeof(string),"* There is nohing you can rob from %s",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!ProxDetectorS(5.0, playerid, giveplayerid))
{
format(string, sizeof(string),"* %s Moved from their spot!",name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if(!IsPlayerConnected(Pickpocket[playerid]))
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline");
return 1;
}
new crack = 20 + random(30);
PlayerInfo[giveplayerid][pCrack] = PlayerInfo[playerid][pCrack]-crack;
PlayerInfo[playerid][pCrack] = PlayerInfo[giveplayerid][pCrack]+crack;
PlayerInfo[playerid][pPocketX] -= 1;
format(string, sizeof(string),"* You robbed %d gram crack From %s!",crack,name2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string),"* %s robbed %d gram From you!",name, crack);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
pCD[playerid] = 1;
SetTimer("Unsetpickpocket",30000,true);
}
}
if(listitem == 2) // Pot
{
}
if(listitem == 3) // Materials
{
}
}
}
The list loads but qwhen you are going to choose something from the list nothing happens :/
your dialog id must be matching with another dialog id which is why it doesn't shows up
if so then write in case. For Example Like This