12.03.2010, 14:50
Kind time of days! I had a problem. I wish to make numbers for the bought cars. But has faced such problem. How to make that number remained in cars.cfg? I use LARP Mod. Here my code of a command.
Код:
if(strcmp(cmd, "/regplate", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /regplate [playerid/PartOfName] [xx-xxx-xxx]"); } giveplayerid = ReturnUser(tmp); if (PlayerInfo[playerid][pAdmin] >= 1) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /regplate [playerid/PartOfName] [xx-xxx-xxx]"); } if(IsPlayerInAnyVehicle(playerid)) { new vehicleid = GetPlayerVehicleID(playerid); new Text3D:VText; format(string,sizeof(string),"%s",(result)); VText = Create3DTextLabel(string,0x008080FF,0.0,0.0,0.0,20,0,1); Attach3DTextLabelToVehicle(Text3D:VText, vehicleid, 0.0, 0.0, 0.0); } return 1; } } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }