//edit:1 if(strcmp("/bla",cmdtext) == 0)
//edit:2 if(!strcmp("/bla",cmdtext))
edit:3 if(!strcmp("bla",cmdtext[1]))
#include <a_samp>
main(){}
public OnGameModeInit(){
OnPlayerCommandText(0,"/test");
return true;
}
public OnPlayerCommandText(playerid,cmdtext[]){
for(new j;j<10;j++){
new
t1,t2,t3,t4,t5;
t1 = GetTickCount();
for(new i; i < 10000000;i++){
if(!strcmp("test",cmdtext[1])){}
}
t2 = GetTickCount();
for(new i; i < 10000000;i++){
if(strcmp("test",cmdtext[1]) == 0){}
}
t3 = GetTickCount();
for(new i; i < 10000000;i++){
if(!strcmp("/test",cmdtext)){}
}
t4 = GetTickCount();
for(new i; i < 10000000;i++){
if(strcmp("/test",cmdtext) == 0){}
}
t5 = GetTickCount();
printf("-%d-%d-%d-%d-",t2-t1,t3-t2,t4-t3,t5-t4);
}
return true;
}
[10:22:59] -1266-1406-1313-1453- [10:23:05] -1265-1407-1296-1454- [10:23:10] -1265-1406-1313-1453- [10:23:16] -1266-1406-1297-1453- [10:23:21] -1281-1406-1297-1438- [10:23:26] -1265-1422-1297-1453- [10:23:32] -1266-1406-1313-1437- [10:23:37] -1281-1407-1297-1453- [10:23:43] -1281-1406-1297-1453- [10:23:48] -1266-1406-1313-1437-
if( !strcmp(cmdtext,"/Drift1",true )) { SetPlayerPos(playerid, -274.9351,1535.3416,75.3594); SendClientMessage(playerid,COLOR_GREEN, "Welcome To drift1"); return 1;
{ if (strcmp("/text", cmdtext, true, 10) == 0) { SendClientMessage(playerid,0xAA3333A,"Text"); return 1;
Originally Posted by [DD
FlameOFDeath ]
a command like teleport or text ill show u both Teleport: ---------- Код:
if( !strcmp(cmdtext,"/Drift1",true )) { SetPlayerPos(playerid, -274.9351,1535.3416,75.3594); SendClientMessage(playerid,COLOR_GREEN, "Welcome To drift1"); return 1; ------------- Код:
{ if (strcmp("/text", cmdtext, true, 10) == 0) { SendClientMessage(playerid,0xAA3333A,"Text"); return 1; |
Originally Posted by [DD
FlameOFDeath ]
where O.o quite simple i learnd sa-mpscripting for these bits and adding stuff onto the server like cars objects quite simple just got a streamer problem i think lol |
if(strcmp("/text",cmdtext,true,10) == 0)
Hmm, I don't make sense : O This is a [Snippet] topic, not a [Help] topic And wrong's here Код:
if(strcmp("/text",cmdtext,true,10) == 0) |
Originally Posted by [DD
FlameOFDeath ]
Quote:
|
Originally Posted by yezizhu
Код:
//edit:1 if(strcmp("/bla",cmdtext) == 0) Код:
//edit:2 if(!strcmp("/bla",cmdtext)) Код:
edit:3 if(!strcmp("bla",cmdtext[1])) |
if(!strcmp("bla",cmdtext[1]))
if(!strcmp("/bla",cmdtext))
if(!strcmp("/bla",cmdtext))
if(strcmp("/bla",cmdtext) == 0)
Originally Posted by °ғαιιοцт°
Quote:
Код:
if(!strcmp("bla",cmdtext[1])) Код:
if(!strcmp("/bla",cmdtext)) Код:
if(!strcmp("/bla",cmdtext)) Код:
if(strcmp("/bla",cmdtext) == 0) |