09.03.2011, 04:40
When i use this command it wont delete the old pickup it removes another random pickup
and its text and add it where i spawned my pickup
Like this the random pickup is outside CJ's house and if you are in range of the pickup it shows
CJ's House on the screen
when i spawn my family safe it moves the pickup outside CJ's house to the location i want to spawn my safe
could someone help me. heres the code:
and its text and add it where i spawned my pickup
Like this the random pickup is outside CJ's house and if you are in range of the pickup it shows
CJ's House on the screen
when i spawn my family safe it moves the pickup outside CJ's house to the location i want to spawn my safe
could someone help me. heres the code:
PHP код:
else if(strcmp(x_nr,"safe",true) == 0)
{
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adjust safe [confirm]");
if(FamilyInfo[family][FamilySafe] != 0)
{
SendClientMessage(playerid, COLOR_GREY," Adjusting the position of your Family's Safe will cost $50,000 !");
SendClientMessage(playerid, COLOR_WHITE,"HINT: Adjusting the position of your Family's Safe will remove its contents.");
}
else
{
SendClientMessage(playerid, COLOR_GREY," Purchasing a Safe for your Family will cost $50,000 !");
SendClientMessage(playerid, COLOR_WHITE,"HINT: Purchasing a Safe will give your Family the ability to store/share Pot, Crack, Cash and Materials.");
}
return 1;
}
if(strcmp(x_nr,"confirm",true) == 0)
{
if(PlayerInfo[playerid][pCash] < 49999)
{
SendClientMessage(playerid, COLOR_GRAD1, " You don't have that much money !");
return 1;
}
if(FamilyInfo[family][FamilySafe] != 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have adjusted the position of your Family's Safe.");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have purchased a Safe.");
SendClientMessage(playerid, COLOR_WHITE, "HINT: Type /safehelp for more information.");
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-50000;
GivePlayerMoney(playerid,-50000);
GetPlayerPos(playerid, FamilyInfo[family][FamilySafePos][0],FamilyInfo[family][FamilySafePos][1],FamilyInfo[family][FamilySafePos][2]);
DestroyPickup(FamilyInfo[family][PickupID]);
FamilyInfo[family][PickupID] = CreatePickup(1210, 23, FamilyInfo[family][FamilySafePos][0],FamilyInfo[family][FamilySafePos][1], FamilyInfo[family][FamilySafePos][2], -1);
FamilyInfo[family][FamilySafe] = 1;
FamilyInfo[family][FamilyCash] = 0;
FamilyInfo[family][FamilyPot] = 0;
FamilyInfo[family][FamilyCrack] = 0;
FamilyInfo[family][FamilyMats] = 0;
SaveFamilies();
return 1;
}
}