Hi everyone . This Command Only For GUPS because GUPS has the function of GetPlayerLocation( playerid ).
I hope you like it .
First,Put this on top.
[pawn]new Mission1[MAX_PLAYERS];[/pawn]
Second,Put this in public OnPlayerDisconnect and public OnPlayerDeath.
[pawn]Mission1[playerid] = 0;[/pawn]
Then,put this main part to public OnPlayerCommandText( playerid, cmdtext[] )
[pawn]else if ( strcmp( cmd, "mission1", true ) == 0 )
{
if ( strcmp( GetPlayerLocation( playerid ), "Docks-Viceport-Vice-City-Mainland", true ) == 1 )SendClientMessage(playerid, COLOR_RED,"[Error] - Please goto the port and find a mule.(use !port).");
else if (!IsPlayerInVehicle(playerid, 96)) SendClientMessage(playerid, COLOR_RED, "Please get on the mule.");
else {
SendClientMessage(playerid ,COLOR_GREEN, "Welcome to mission 1.In this mission you should drive your mule to the mall,let we go!");
RemovePlayerFromVehicle(playerid);
SetPlayerSkin(playerid, 0);
SetPlayerSkin(playerid, 159);
PutPlayerInVehicle(playerid, 96);
GameTextForPlayer(playerid,"~p~mission ~r~1 ~y~started");
SendClientMessage(playerid, COLOR_YELLOW, "OK,let we goto the mall.If you arrive the mall,please type /c mission1f to get some money.");
Mission1[playerid] = 1;
}
return 1;
}
else if ( strcmp( cmd, "mission1f", true ) == 0 )
{
if ( strcmp( GetPlayerLocation( playerid ), "North-Point-Mall-Vice-Point-Vice-City-Beach", true ) == 1 )SendClientMessage(playerid, COLOR_RED,"[Error] - You can only steal in an area near the mall.");
else if (Mission1[playerid] == 0) {
SendClientMessage(playerid,0xAA3333AA,"You haven't started the mission yet,type /c mission1 to view the mission.");
}
else{
new plname[24];
new szMsg[256];
SetPlayerMoney(playerid, GetPlayerMoney(playerid) + 10000);
SendClientMessage(playerid, 0x33CCFFAA, "congratulation!!You have finished the mission1 already.You have got money = 10000 already!");
GameTextForPlayer(playerid,"~y~congratulation~p~!!!!");
GetPlayerName(playerid,plname,24);
format(szMsg, sizeof(szMsg), "%s has finished mission 1 and get money = 10000!Do you want finish it too?Type /c mission1 !!",plname);
SendClientMessageToAll(0xF6A113FF,szMsg);
RemovePlayerFromVehicle(playerid);
SetVehicleToRespawn(96);
Mission1[playerid] = 0;
}
return 1;
}[/pawn]
When you finish these Step,Enjoy it!!