i cannot accept his message ( sendername )
#1

Whats wrong in this code so that I can not accept his message



this is command /service 1 (taxi)
PHP код:
CMD:service(playeridparams[])
{
    if(
TelahLogin[playerid]==0) return SCM(playerid,warna_merah,"kamu belum login");
    if(
isnull(params)) return SendClientMessage(playeridwarna_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;

Reply
#2

Please explain your problem well.
Reply
#3

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
Please explain your problem well.
I'm creating a taxi system, I mean, when someone types /service taxi, the message is only appears to someone who does that instead, not for the taxi drivers on duty. How to make it appear in taxi drivers on duty?
Reply
#4

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
Reply
#5

Quote:
Originally Posted by khRamin78
Посмотреть сообщение
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
PHP код:
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);
        }
    }

Reply
#6

Quote:
Originally Posted by khRamin78
Посмотреть сообщение
PHP код:
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);
        }
    }

Awesome thanks bro rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)