Define these
#define CP_FISH 26
new FishTimer[MAX_PLAYERS];
new iFishExp[MAX_PLAYERS];
new iFishLvl[MAX_PLAYERS];
This is a new public
public Fish(playerid)
{
new string[256];
new rand = random(sizeof(FishCaught));
if(iFishLvl[playerid] == 0){
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid, FishCaught[rand]*50);
format(string, sizeof(string), "You have caught %d fish, and you sold them for $%d.",FishCaught[rand], FishCaught[rand]*50);
SendClientMessage(playerid, COLOR_YELLOW, string);
iFishExp[playerid] ++;
if(iFishExp[playerid] == 3){
iFishLvl[playerid] ++;
format(string, sizeof(string), "You have went up a Fishing Level your level is now: %d .", iFishLvl);
SendClientMessage(playerid, COLOR_RED, string);
}
}
else if(iFishLvl[playerid] == 1){
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid, FishCaught[rand]*100);
format(string, sizeof(string), "You have caught %d fish, and you sold them for $%d.",FishCaught[rand], FishCaught[rand]*100);
SendClientMessage(playerid, COLOR_YELLOW, string);
iFishExp[playerid] ++;
if(iFishExp[playerid] == 4){
iFishLvl[playerid] ++;
format(string, sizeof(string), "You have went up a Fishing Level your level is now: %d .", iFishLvl);
SendClientMessage(playerid, COLOR_RED, string);
iFishExp[playerid] = 0;
}
}
else if(iFishLvl[playerid] == 2){
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid, FishCaught[rand]*250);
format(string, sizeof(string), "You have caught %d fish, and you sold them for $%d.",FishCaught[rand], FishCaught[rand]*250);
SendClientMessage(playerid, COLOR_YELLOW, string);
iFishExp[playerid] ++;
if(iFishExp[playerid] == 6){
iFishLvl[playerid] ++;
format(string, sizeof(string), "You have went up a Fishing Level your level is now: %d .", iFishLvl);
SendClientMessage(playerid, COLOR_RED, string);
iFishExp[playerid] = 0;
}
}
else if(iFishLvl[playerid] == 3){
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid, FishCaught[rand]*500);
format(string, sizeof(string), "You have caught %d fish, and you sold them for $%d.",FishCaught[rand], FishCaught[rand]*500);
SendClientMessage(playerid, COLOR_YELLOW, string);
iFishExp[playerid] ++;
if(iFishExp[playerid] == 8){
iFishLvl[playerid] ++;
format(string, sizeof(string), "You have went up a Fishing Level your level is now: %d .", iFishLvl);
SendClientMessage(playerid, COLOR_RED, string);
iFishExp[playerid] = 0;
}
}
else if(iFishLvl[playerid] == 4){
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid, FishCaught[rand]*750);
format(string, sizeof(string), "You have caught %d fish, and you sold them for $%d.",FishCaught[rand], FishCaught[rand]*750);
SendClientMessage(playerid, COLOR_YELLOW, string);
iFishExp[playerid] ++;
if(iFishExp[playerid] == 10){
iFishLvl[playerid] ++;
format(string, sizeof(string), "You have went up a Fishing Level your level is now: %d .", iFishLvl);
SendClientMessage(playerid, COLOR_RED, string);
iFishExp[playerid] = 0;
}
}
else if(iFishLvl[playerid] == 5){
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid, FishCaught[rand]*1000);
format(string, sizeof(string), "You have caught %d fish, and you sold them for $%d.",FishCaught[rand], FishCaught[rand]*1000);
SendClientMessage(playerid, COLOR_YELLOW, string);
iFishExp[playerid] ++;
if(iFishExp[playerid] == 15){
iFishLvl[playerid] ++;
format(string, sizeof(string), "You have went up a Fishing Level your level is now: %d .", iFishLvl);
SendClientMessage(playerid, COLOR_RED, string);
iFishExp[playerid] = 0;
}
}
}
if (strcmp(cmdtext, "/fish", true) == 0) {
GameTextForPlayer(playerid,"Go to the ~r~Fishing Spot",30000,3);
SetPlayerCheckpoint(playerid,-2062.2234,-1290.9171,1.0934,1.0);
gPlayerCheckpointStatus[playerid] = CP_FISH;
return 1;
}
Goes in checkpoint
case CP_FISH:
{
TogglePlayerControllable(playerid,0);
DisablePlayerCheckpoint(playerid);