CMD:service(playerid, params[])
{
if(TelahLogin[playerid]==0) return SCM(playerid,warna_merah,"kamu belum login");
if(isnull(params)) return SendClientMessage(playerid, warna_biru, "Gunakan: /service [1.taxi/2.medic]");
if(!strcmp(params,"1",true))
{
new str[90],pID,sendername[MAX_PLAYER_NAME+12];
GetPlayerName(pID,sendername,sizeof(sendername));
if(PlayerInfo[playerid][pJobTaxi] == 1) return SendClientMessage(playerid,warna_putih,"Kamu seorang driver taxi dan tidak semestinya menggunakan command ini");
if(taxidriver < 1) return SendClientMessage(playerid,warna_coklattua,"Sekarang tidak ada pengemudi taxi yang bertugas, tunggu beberapa saat");
SendClientMessage(playerid,warna_putih,"Kamu sudah memanggil taxi");
if(taxidriver >= 1){
format(str,sizeof(str),"Seorang Bernama %s memanggil taxi driver ketik '/accept taxi' untuk menerimanya",sendername);
SendClientMessage(PlayerInfo[pID][pJobTaxi],warna_biru,str);
}
}
else if(!strcmp(params,"2",true))
{
}
return 1;
}
see dude u have to make a loop to check who is a taxi driver which is on duty then sent them message as im seeing you are sending that massage for noone
use for(new i;i<MAX_PLAYER;i++) {} for looping through all players if you need help to how to make that just tell ill make it for you and post it here |
if(!strcmp(params,"1",true))
{
if(taxidriver < 1) return SendClientMessage(playerid,warna_coklattua,"Sekarang tidak ada pengemudi taxi yang bertugas, tunggu beberapa saat");
if(PlayerInfo[playerid][pJobTaxi] == 1) return SendClientMessage(playerid,warna_putih,"Kamu seorang driver taxi dan tidak semestinya menggunakan command ini");
new str[90],sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid,sendername,sizeof(sendername));
SendClientMessage(playerid,warna_putih,"Kamu sudah memanggil taxi");
format(str,sizeof(str),"Seorang Bernama %s memanggil taxi driver ketik '/accept taxi' untuk menerimanya",sendername);
for(new i;i<MAX_PLAYER;i++)
{
if(PlayerInfo[i][pJobTaxi] == 1)
{
SendClientMessage(i,warna_biru,str);
}
}
}
PHP код:
|