06.05.2018, 09:49
Strings are arrays of symbols, read some theory @ SA-MP wiki.
Hope you get the idea. The variable you defined is an integer, not a string.
and you define strings as if you were defining an array...
Код:
CMD:port(playerid,params[]) { new lokejsn[8]; //Since lokejsn is a string, you define it as an array like that. if(sscanf(params,"s[8]",lokejsn)) return SendClientMessage(playerid,COLOR_GREY,"Usage: /port [location]"); //I have to admit, since you type location ID, if I were you, I had rather stick to integer, but it's up to you to decide that, so I'll patch it up your way. //You do need to define array size in sscanf line there; and you don't need to do !sscanf later, it's irrelative and is not required. if(!strcmp(lokejsn, "1", true)) { JBC_SetPlayerPos(playerid,1819.2871,-2066.6099,13.3828); } //DIY other location numbers like that ... ... if(!strcmp(lokejsn, "16", true)) { JBC_SetPlayerPos(playerid,1228.7247,-1565.4233,13.5741); } SendClientMessage(playerid,GRAY,"Teleported!"); return 1; }
Код:
new lokejsn;
Код:
new lokejsn[SIZE];