refill - problem!
#1

how can i make this "/refill [name] [price] [reason]"

PHP код:
    if(strcmp(cmd"/refill"true) == 0)
                    {
                        if(
IsPlayerConnected(playerid))
                        {
                              if (
PlayerInfo[playerid][pMember] == 15)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   You are not a Car Mechanic!");
                                return 
1;
                            }
                            
tmp strtok(cmdtextidx);
                            if(!
strlen(tmp))
                            {
                                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /refill [playerid/PartOfName] [price]");
                                return 
1;
                            }
                            new 
playa;
                            new 
money;
                            
playa ReturnUser(tmp);
                            
tmp strtok(cmdtextidx);
                            
money strval(tmp);
                            if(
money || money 99999) { SendClientMessage(playeridCOLOR_GREY"   Price not lower then 1, or above 99999!"); return 1; }
                            if(
IsPlayerConnected(playa))
                            {
                                if(
playa != INVALID_PLAYER_ID)
                                {
                                    if(
ProxDetectorS(8.0playeridplaya)&& IsPlayerInAnyVehicle(playa))
                                    {
                                        if(
playa == playerid) { SendClientMessage(playeridCOLOR_GREY"   Can't do that!"); return 1; }
                                        
GetPlayerName(playagiveplayersizeof(giveplayer));
                                        
GetPlayerName(playeridsendernamesizeof(sendername));
                                        
format(stringsizeof(string), "* Iai oferit lui %s ca sa-i faci plinu cu %dLei .",giveplayer,money);
                                        
SendClientMessage(playeridCOLOR_PURPLEstring);
                                        
format(stringsizeof(string), "* Mecanicul %s vrea sa-ti faca plinu cu %dLei, (scrie /accepta refill) pentru a accepta.",sendername,money);
                                        
SendClientMessage(playaCOLOR_LIGHTBLUEstring);
                                        
RefillOffer[playa] = playerid;
                                        
RefillPrice[playa] = money;
                                    }
                                    else
                                    {
                                        
SendClientMessage(playeridCOLOR_GREY"   That player is not near you / not in a car.");
                                    }
                                }
                            }
                            else
                            {
                                
SendClientMessage(playeridCOLOR_GREY"   That player is offline.");
                            }
                        }
                        return 
1;
                    } 
Reply


Messages In This Thread
refill - problem! - by Akcent_Voltaj - 03.10.2012, 11:05
Re: refill - problem! - by Roel - 03.10.2012, 11:32
Re: refill - problem! - by KingHual - 03.10.2012, 11:33
Re: refill - problem! - by Roel - 03.10.2012, 11:36
Re: refill - problem! - by Akcent_Voltaj - 03.10.2012, 11:38
Re: refill - problem! - by KingHual - 03.10.2012, 11:39
Re: refill - problem! - by Roel - 03.10.2012, 11:42
Re: refill - problem! - by Roel - 03.10.2012, 11:44
Re: refill - problem! - by Akcent_Voltaj - 03.10.2012, 11:47
Re: refill - problem! - by KingHual - 03.10.2012, 11:49

Forum Jump:


Users browsing this thread: 4 Guest(s)