need help with sscanf(params
#8

Quote:
Originally Posted by MehranGta
Посмотреть сообщение
A new one :
pawn Код:
CMD:veh(playerid,params[]) {
    if(pInfo[playerid][Adminlevel] < 1) {
        new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
        if(isnull(tmp)) return SendClientMessage(playerid, red, "Karbord: /car [Modelid/Name] [colour1] [colour2]");
        new car, colour1, colour2, string[128];
        if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
        if(car < 400 || car > 611) return  SendClientMessage(playerid, red, "KHATA: Invalid Vehicle Model");
        if(isnull(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
        if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
        if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[playerid][pCar]);
        new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1;   GetPlayerPos(playerid, X,Y,Z);  GetPlayerFacingAngle(playerid,Angle);   int1 = GetPlayerInterior(playerid);
        LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1); PutPlayerInVehicle(playerid, LVehicleID, 0);
        PlayerInfo[playerid][pCar] = LVehicleID;
        CMDMessageToAdmins(playerid,"CAR");
        format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
        SaveToFile("CarSpawns",string);
        format(string, sizeof(string), "Shoma Yek \"%s\" (Model:%d) Ba Range (%d, %d) Be Vojood Avordid", VehicleNames[car-400], car, colour1, colour2);
        return SendClientMessage(playerid,lightblue, string);
    } else return SendClientMessage(playerid,red,ERROR_MESSAGE);
}
thanks for the help i got it using sscanf + rep
Reply


Messages In This Thread
need help with sscanf(params - by AroseKhanNiazi - 19.07.2014, 23:33
Re: need help with sscanf(params - by sammp - 19.07.2014, 23:40
Re: need help with sscanf(params - by AroseKhanNiazi - 19.07.2014, 23:46
Re: need help with sscanf(params - by TheKillZone - 20.07.2014, 00:21
Re: need help with sscanf(params - by AroseKhanNiazi - 20.07.2014, 00:30
Re: need help with sscanf(params - by AroseKhanNiazi - 20.07.2014, 14:51
Re: need help with sscanf(params - by MehranGta - 20.07.2014, 17:10
Re: need help with sscanf(params - by AroseKhanNiazi - 20.07.2014, 17:28

Forum Jump:


Users browsing this thread: 2 Guest(s)