public OnGameModeInit()
{
CreateObject(1318,-64.00827789,-1120.72668457,0.71267354,0.00000000,0.00000000,332.00000000); //object(arrow) (1)
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
GivePlayerMoney(playerid, 7500);
SendClientMessage(playerid, blue, "Congratulations, you have earned 7500");
DisablePlayerCheckpoint(playerid);
return 1;
}
COMMAND:work(playerid, cmdtext)
{
if (!IsPlayerInRangeOfPoint(playerid, 7.0, -64.1551,-1120.6709,1.0781))
{
return SendClientMessage(playerid, COLOR_RED, "You're not in range of the job");
}
SendClientMessage(playerid, blue, "Welcome to work!");
SendClientMessage(playerid, yellow, "Please drive to the checkpoint to recieve your reward.");
new thevehicle = CreateVehicle(498, -79.2382, -1128.1711, 1.0781, 0.0, 0, 0, 5000);
PutPlayerInVehicle(playerid, thevehicle, 0);
SetPlayerCheckpoint(playerid, 1827.8311,-1075.7113,23.9317, 4.0);
return 1;
}
public OnGameModeInit()
{
CreateObject(1318,-64.00827789,-1120.72668457,0.71267354,0.00000000,0.00000000,332.00000000); //object(arrow) (1)
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
new vehicle = GetPlayerVehicle(playerid); // declares a new var called "vehicle"
if(vehicle == 498) // checking if the vehicle is 498 else it will return a error message
{
GivePlayerMoney(playerid, 7500);
SendClientMessage(playerid, blue, "Congratulations, you have earned 7500");
DisablePlayerCheckpoint(playerid);
}
else
{
SendClientMessage(playerid, -1, "YOUR ERROR MESSAGE - YOUR VEHICLE IS NOT 498");
}
return 1;
}
COMMAND:work(playerid, params[]) // zcmd always works with "params[]" I don't think "cmdtext" will work.
{
if (!IsPlayerInRangeOfPoint(playerid, 7.0, -64.1551,-1120.6709,1.0781))
{
return SendClientMessage(playerid, COLOR_RED, "You're not in range of the job");
}
else
{
SendClientMessage(playerid, blue, "Welcome to work!");
SendClientMessage(playerid, yellow, "Please drive to the checkpoint to recieve your reward.");
new thevehicle = CreateVehicle(498, -79.2382, -1128.1711, 1.0781, 0.0, 0, 0, 5000);
PutPlayerInVehicle(playerid, thevehicle, 0);
SetPlayerCheckpoint(playerid, 1827.8311,-1075.7113,23.9317, 4.0);
}
return 1;
}
if(GetVehicleModel(vehicleid) != 498) return SendClientMessage(playerid, -1 "Message here");
thank you guys. +rep but since it's setplayercheckpoint, as soon as i see another checkpoint in my game, the work checkpoint destination disappears. can anyboddy help me?
|
thank you guys. +rep but since it's setplayercheckpoint, as soon as i see another checkpoint in my game, the work checkpoint destination disappears. can anyboddy help me?
|
for that you need a streamer plugin in which you can stream as many checkpoints you want.
or just use vars, new cp = CreateDynamicCP(...); like that. and then use it ![]() https://sampforum.blast.hk/showthread.php?tid=102865 -FalconX |
hello, i already have the streamer plugin but what and where do i add it in my script?
|
#include <streamer>
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 498)
{
SendClientMessage(playerid, 0xFFFFFFFF, "End Work!");
GivePlayerMoney(playerid, 1000); //Money
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You don't in 498 Vehicle Model and no Give your money!");
}
you need it to include it to your game-mode. Like the following:-
pawn Код:
-FalconX |