-
Notifications
You must be signed in to change notification settings - Fork 0
/
Improved_Moving_Shop.txt
63 lines (63 loc) · 1.81 KB
/
Improved_Moving_Shop.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@name Pie's Moving Shop
@persist [S,SP]:entity [P] Ped:vector
if (first()){
runOnChat(1)
}
if (chatClk(owner())){
LS=owner():lastSaid():explode(" ")
switch(LS[1,string]){
case "!s",
E=owner():aimEntity()
if(E:isShipment()){
S=E
P=S:shipmentPrice()/10*S:shipmentAmount()*LS[2,string]:toNumber()
print("Save Successfull")
print("Name: "+ S:shipmentName())
print("Amount: "+S:shipmentAmount())
print("Price: "+P)
local Pos=S:pos()+vec(0,0,50)
S:setPos(entity():pos()+vec(0,0,10))
SP=propSpawn(S:shipmentModel(),Pos,1)
runOnUse(1,SP)
} else {
print("Error: Invalid Shipment")
}
break
case "!sell",
SP:setPos(Ped+vec(0,0,10))
break
case "!get",
S:setPos(owner():aimPos())
break
case "!set",
Ped=owner():aimPos()
break
default,
break
}
} else {
if(moneyClk()){
Pos=SP:pos()
SP:propDelete()
S:setPos(Pos)
} elseif(moneyNoClk()){
print(moneyNoClkPlayer():name()+"Rejected Payment")
} elseif(SP:inUse()){
E=SP:inUseBy()
print(E:name())
if(E:isPlayer()){
if(S:isValid()){
if(E:money()>=P){
moneyRequest(E,P,S:shipmentAmount()+S:shipmentName()+"s for: $" + P)
print("Requesting $" + P + " from "+E:name()+".")
}else{
print(E:name() + " is too poor.")
}
} else{
print("Shipment Not Found")
}
} else{
print("Player Not Found")
}
}
}