SA-MP Forums Archive
"/sethousecar" not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: "/sethousecar" not working (/showthread.php?tid=262005)



"/sethousecar" not working - Jack_Leslie - 16.06.2011

So this is really the first code I've 100% put together, and it doesn't work D:

Код:
	if(strcmp(cmd, "/sethousecar", true) == 0)
	{
	    if(!PlayerInfo[playerid][pAdmin] >=4)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command!");
	            return 1;
         	}
            tmp = strtok(cmdtext, idx);
            if (!strlen(tmp))
            {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /sethousecar [playerid] [vehicle id] e.g. 444");
            return 1;
            }
            else
			{
            new playac;
            new chousecar;
            playac = ReturnUser(tmp);
            chousecar = strvalEx(tmp);
            HouseVehicleIDTemp[playac] = CreateVehicle(PlayerInfo[playac][chousecar],PlayerInfo[playac][pHouseCarX],PlayerInfo[playac][pHouseCarY],PlayerInfo[playac][pHouseCarZ],PlayerInfo[playac][pHouseCarFacing],PlayerInfo[playac][pHouseCarColor],PlayerInfo[playac][pHouseCarColor2], 900);
			SendClientMessage(playerid, COLOR_RED, "You have set %s housecar to %d", playac, chousecar);
			return 1;
			}
			return 1;
			}
EDIT:
I've got it to work to this point
Код:
tmp = strtok(cmdtext, idx);
            if (!strlen(tmp))
            {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /sethousecar [playerid] [vehicle id] e.g. 444");
            return 1;
            }
            else
^ Stops there