Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

Commit

Permalink
Updated example gamemode script
Browse files Browse the repository at this point in the history
  • Loading branch information
LemonHaze420 committed Apr 4, 2018
1 parent 81275b5 commit 0104497
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vice-city-coop/server/Scripts/Server/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function onServerStart()
local randColorB = GetRandomVehicleColor()

AddVehicle(modelID, 538.117798, 626.908203, 10.901563, randColorA, randColorB)
AddVehicle(modelID, 540.117798, 630.908203, 10.901563, randColorA, randColorB)
end
function onPlayerConnect(id)
print("Player "..GetPlayerName(id).. " joined!")
Expand All @@ -21,4 +22,13 @@ function onPlayerMessage(playerid, msg)
if (matchText) then
SetPlayerModel(playerid, matchText)
end

matchText,ammo = string.match(msg, "/weapon (%d+) (%d+)")
if (matchText and ammo) then
GivePlayerWeapon(playerid, matchText, ammo)
SendPlayerMessage(playerid, "Given weapon "..matchText.." with "..ammo.." ammo.")
else
SendPlayerMessage(playerid, "Incorrect arguments!")
SendPlayerMessage(playerid, "/weapon <weapon id> (ammo)")
end
end

0 comments on commit 0104497

Please sign in to comment.